#11287: Interface to runsnake and import_statements
------------------------------------------+---------------------------------
   Reporter:  nthiery                     |          Owner:  tbd                
              
       Type:  enhancement                 |         Status:  needs_review       
              
   Priority:  major                       |      Milestone:  sage-4.7.1         
              
  Component:  performance                 |       Keywords:  runsnake, prun, 
profiling, days30
Work_issues:                              |       Upstream:  N/A                
              
   Reviewer:  Franco Saliola, Simon King  |         Author:  Nicolas M. ThiƩry  
              
     Merged:                              |   Dependencies:                     
              
------------------------------------------+---------------------------------

Comment(by SimonKing):

 I just opened #11298 (ready for review).

 With it, we obtain:
 {{{
 sage: from sage.misc.sageinspect import sage_getsourcelines, sage_getfile
 sage: P.<x,y> = QQ[]
 sage: P._init_category_(Algebras(QQ))
 sage: P.__module__
 'sage.categories.algebras'
 sage: sage_getfile(P)
 
'/mnt/local/king/SAGE/sage-4.7.alpha5/devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pyx'
 sage: lines, lineno = sage_getsourcelines(P)
 sage: lines[0]
 'cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):\n'
 }}}

 It should be easy to extract the module name from the file name (here:
 `sage.rings.polynomial.multi_polynomial_libsingular`, not
 `sage.categories.algebras`). Moreover, it should be easy to extract the
 correct class name from the first line of the source code (`ClassName`,
 not `ClassName_with_category` or `SomeCategory.parent_class`, which would
 not work in an import statement).

 Cheers,
 Simon

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11287#comment:10>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to