Opened 13 years ago

Closed 10 years ago

#6880 closed defect (worksforme)

docstrings and @cached_method -- if you used cached_method then docstring displays wrong file, etc.

Reported by: William Stein Owned by: tba
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: documentation Keywords:
Cc: Merged in:
Authors: Reviewers: Simon King
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


If you used the @cached_method decorator when defining a function in the Sage library, then get help about it (either in the notebook or command line), the File: field lis as follows:

File:           /.../local/lib/python2.6/site-packages/sage/misc/

That's of course technically right, but very wrong/misleading for the user, who maybe wants to know more. We should add specialized code to IPython and the notebook to correct for this.

Change History (3)

comment:1 Changed 10 years ago by Simon King

Report Upstream: N/A
Reviewers: Simon King
Status: newneeds_review

This problem has already been fixed (by some work in sage.misc.sageinspect - sorry, I am too lazy to look up the ticket number). For example:

sage: P.<x,y> = QQ[]
sage: I = P*[x,y]
sage: I.groebner_basis?
Type:           CachedMethodCaller
Base Class:     <type 'sage.misc.cachefunc.CachedMethodCaller'>
String Form:    Cached version of <function groebner_basis at 0x1507b18>
Namespace:      Interactive
Loaded File:    /home/simon/SAGE/sage-5.0/local/lib/python2.7/site-packages/sage/misc/
Source File:    /home/simon/SAGE/sage-5.0/devel/sage/sage/misc/
Definition:     I.groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=False, *args, **kwds)
    File: sage/rings/polynomial/ (starting at line 3476)

Hence, we can close this.

comment:2 Changed 10 years ago by Simon King

Milestone: sage-5.1sage-duplicate/invalid/wontfix
Status: needs_reviewpositive_review

comment:3 Changed 10 years ago by Jeroen Demeyer

Resolution: worksforme
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.