-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #12601: @cached_method does not work for special methods
Caching does not work for the {{{~}}} operator. {{{ sage: class A(object): ... @cached_method ... def __invert__(self): ... return 1 sage: a = A() sage: ~a is ~a False }}} Also the value of {{{a.__invert__}}} changes when calling {{{~a}}}. This happens because special methods are called through the type and not the actual instance for new-style classes: http://docs.python.org/releas e/2.7.2/reference/datamodel.html?highlight=data%20model#special-method- lookup-for-new-style-classes As of 5.0.beta4 no operators in sage use {{{@cached_method}}}. URL: http://trac.sagemath.org/12601 Reported by: saraedum Ticket author(s): Simon King Reviewer(s): Nils Bruin
- Loading branch information
Showing
1 changed file
with
191 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters