#16382: make sage_getsourcelines and sage_getfile consistent
----------------------+----------------------------
   Reporter:  nbruin  |            Owner:
       Type:  defect  |           Status:  new
   Priority:  major   |        Milestone:  sage-6.3
  Component:  misc    |         Keywords:
  Merged in:          |          Authors:
  Reviewers:          |  Report Upstream:  N/A
Work issues:          |           Branch:
     Commit:          |     Dependencies:
   Stopgaps:          |
----------------------+----------------------------
 We presently have:
 {{{
 sage: sage_getsource(hyperbolic_triangle) in
 open(sage_getfile(hyperbolic_triangle),'r').read()
 False
 }}}
 The problem is that `hyperbolic_triangle` is wrapped and its source is
 provided by a `_sage_src_lines_()` method, but on the `getfile` front,
 there is no analogue, so the file isn't found. That means `edit` doesn't
 work properly.

 One solution is to provide a parallel method `_sage_src_file_()`. Another,
 which requires more editing, is to change `sage_getsourcelines` to return
 a triple `([lines],lineno,filename)` instead of `([lines],lineno)` as it
 does now (it's a little strange to return a line number without the file
 into which this indexes anyway). Note that `filename` could end up being
 something that doesn't actually open, because interactively defined
 classes get funny "filenames" that, via the `inspect` linecache, actually
 can used to index source lines without having a file correspond to them.

--
Ticket URL: <http://trac.sagemath.org/ticket/16382>
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/d/optout.

Reply via email to