Opened 12 years ago

Closed 9 years ago

#6880 closed defect (worksforme)

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

Reported by: was 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

Description

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/cachefunc.py

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 9 years ago by SimonKing

  • Report Upstream set to N/A
  • Reviewers set to Simon King
  • Status changed from new to needs_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/cachefunc.so
Source File:    /home/simon/SAGE/sage-5.0/devel/sage/sage/misc/cachefunc.so
Definition:     I.groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=False, *args, **kwds)
Docstring:
    File: sage/rings/polynomial/multi_polynomial_ideal.py (starting at line 3476)
...

Hence, we can close this.

comment:2 Changed 9 years ago by SimonKing

  • Milestone changed from sage-5.1 to sage-duplicate/invalid/wontfix
  • Status changed from needs_review to positive_review

comment:3 Changed 9 years ago by jdemeyer

  • Resolution set to worksforme
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.