Opened 11 years ago

Closed 6 years ago

#9680 closed defect (wontfix)

Don't greedily replace 'self' with classname in documentation

Reported by: boothby Owned by: mvngu
Priority: trivial Milestone: sage-duplicate/invalid/wontfix
Component: documentation Keywords:
Cc: Merged in:
Authors: Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

I just found this gem. Apparently, something replaces "self" with the current classname in the documentation. Amusingly, this almost made something comprehensible by accident.

sage: DLXMatrix?
...
The 0 entry is reserved internally... Blame the original author, or fix it yourDLXMatrix.

where it should read "yourself" at the end of the sentence.

Change History (4)

comment:1 Changed 11 years ago by jhpalmieri

I only see this in the notebook. The cause for the replacement lies in the file sagenb/misc/sageinspect.py, the line

        s = s.replace('self.','%s.'%obj_name)

in the function sage_getdoc. There is an identical line in sage/misc/sageinspect.py, so I'm not sure why this doesn't show up in the command line, but I don't remember all the intricacies of how docstrings are produced in the two settings.

comment:2 Changed 6 years ago by mmezzarobba

  • Milestone set to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

DLXMatrix? now (6.6.rc3) displays

  ...
   Note: The 0 entry is reserved internally for headers in the
     sparse representation, so rows and columns begin their indexing
     with 1. Apologies for any heartache this causes. Blame the
     original author, or fix it yourself.
   ...

as expected.

comment:3 Changed 6 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to positive_review

comment:4 Changed 6 years ago by vbraun

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