#16382: make sage_getsourcelines and sage_getfile consistent
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-6.3
      Component:  misc               |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/nbruin/ticket/16382              |  44275215ec879beecb094940948553b156a871e0
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by nbruin):

 * commit:   => 44275215ec879beecb094940948553b156a871e0


Comment:

 Also, note:
 {{{
 sage: P.<x,y> = QQ[]
 sage: P._sage_src_lines_()
 TypeError: _sage_src_lines() takes no arguments (1 given)
 }}}
 which is currently relied on to detect a dynamic class instance. The
 method in question tries to make a static method, but the subsequent
 inclusion into a dynamic class dictionary seems to break this (hence, the
 method binds anyway and the call receives an unexpected `self` argument).

 If one fixes `_sage_src_lines` (by for instance accepting an optional self
 argument), source retrieval gets broken! So I think the current
 implementation of `_sage_src_lines` is actually wrong. It should either be
 removed (and the rest of the infrastructure adapted to detect dynamic
 classes in a different way--which is possible, because its current desired
 behaviour is apparently to raise a `TypeError` on instances of dynamic
 classes, which could be refactored), or it should be implemented to return
 the correct contents. Of course `_sage_src_file` could then be corrected
 similarly.
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=44275215ec879beecb094940948553b156a871e0
 4427521]||{{{trac 16382: experimental implementation for improved source
 file introspecion}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/16382#comment:2>
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