#15759: cached_method: __name__ and __module__ attributes; callable as
functions /
class bound methods
-----------------------+-------------------------------
Reporter: nthiery | Type: enhancement
Status: new | Priority: major
Milestone: sage-6.1 | Component: misc
Resolution: | Report Upstream: N/A
-----------------------+-------------------------------
This ticket adds the following features to cached methods to make them
behave more like usual methods:
- __name__ and __module__ attributes
- calling them as functions / methods bound on a class:
{{{
class Foo:
@cached_method
def f(self):
...
sage: instance = Foo()
sage: Foo.f(instance) is instance.f()
sage: Foo.__dict__['f'](instance) is instance(f)
}}}
This makes them compatible with, e.g., deprecated_function_alias:
{{{
class Foo:
@cached_method
def f(self):
...
bar = deprecated_function_alias(12963, f)
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15759>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.