#11585: Make deprecated_function_alias print the whole module path when it 
differs
from the original
----------------------------+-----------------------------------------------
    Reporter:  defeo        |         Owner:                            
        Type:  enhancement  |        Status:  needs_work                
    Priority:  minor        |     Milestone:  sage-5.0                  
   Component:  misc         |    Resolution:                            
    Keywords:  deprecation  |   Work_issues:  startuptime               
    Upstream:  N/A          |      Reviewer:  Rob Beezer, Florent Hivert
      Author:  Luca De Feo  |        Merged:                            
Dependencies:               |  
----------------------------+-----------------------------------------------
Changes (by hivert):

  * owner:  jason =>


Comment:

 Here is what I think is a good solution {{{inspect.currentframe(1)}}} does
 the
 same as {{{inspect.stack()[1][0]}}} only 400 time faster:
 {{{
 sage: import inspect
 sage: inspect.getmodule(inspect.stack()[1][0]) ==
 inspect.getmodule(inspect.currentframe(1))
 True
 sage: timeit('inspect.getmodule(inspect.stack()[1][0])')
 25 loops, best of 3: 15.6 ms per loop
 sage: timeit('inspect.getmodule(inspect.currentframe(1))')
 625 loops, best of 3: 40.7 µs per loop
 }}}
 I'm updating the patch accordingly.

 Florent

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