#11342: Make getattr faster on parents and elements
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |          Owner:                        
       Type:  enhancement  |         Status:  needs_work            
   Priority:  major        |      Milestone:  sage-4.7.2            
  Component:  performance  |       Keywords:  getattr parent element
Work_issues:               |       Upstream:  N/A                   
   Reviewer:               |         Author:  Simon King            
     Merged:               |   Dependencies:  #9944                 
---------------------------+------------------------------------------------

Comment(by SimonKing):

 In my Sage version, the init method of an object such as `pari(x)` looks
 as follows:
 {{{
 #!python
     def __init__(self):
         self.b = 0
         self._parent = P
         self._refers_to = {}
 }}}
 That is sage/libs/pari/gen.pyx at line 391. How does it look in your Sage
 version?

 P should be defined as
 {{{
 #!python
 cdef PariInstance pari_instance, P
 pari_instance = PariInstance(16000000, 500000)
 P = pari_instance   # shorthand notation
 }}}
 at lines 176 ff.

 Could you test whether P is None when it is used in the `__init__` method
 (lines 391 ff)?

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