#13174: Wrong documentation for methods @cached_method
-----------------------------+----------------------------------------------
Reporter: Snark | Owner: mvngu
Type: defect | Status: new
Priority: critical | Milestone: sage-5.1
Component: documentation | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
Calling help on a cached method returns the help for cached_method, not
for the actual method being cached :
{{{
sage:chi=DirichletGroup(6).0
sage:help(chi.conductor)
Help on CachedMethodCallerNoArgs in module sage.modular.dirichlet:
conductor(...)
File: sage/misc/cachefunc.pyx (starting at line 1259)
Utility class that is used by :class:`CachedMethod` to bind a
cached method to an instance, in the case of a method that does
not accept any arguments except ``self``.
NOTE:
The return value ``None`` would not be cached. So, if you have
a method that does not accept arguments and may return ``None``
after a lengthy computation, then ``@cached_method`` should not
be used.
EXAMPLE::
sage: P.<a,b,c,d> = QQ[]
sage: I = P*[a,b]
sage: I.gens
Cached version of <function gens at 0x...>
sage: type(I.gens)
<type 'sage.misc.cachefunc.CachedMethodCallerNoArgs'>
sage: I.gens is I.gens
True
sage: I.gens() is I.gens()
True
AUTHOR:
- Simon King (2011-04)
}}}
This is with 5.1.beta6 on an x86_64 box ; and I think it's a pretty big
bug since introspection is an important feature of sage.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13174>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.