#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):

 Replying to [comment:36 vbraun]:
 > Notice how Pari's `PariInstance.__init__` generates elements like
 `PariInstance.PARI_ZERO`. But during the construction of `pari_instance`,
 it can't set the parent to anything non-null.

 Yes it can! If I understand correctly, you say that the pari instance
 creates some elements while its own initialisation is not complete yet.
 Apparently it is supposed that there exists exactly one pari instance.
 Hence, if that instance is initialised, and if some elements are created
 during initialisation, then one can certainly assign `self` to the
 `._parent` attribute of these elements.

 But, frankly, the `__init__` in sage/libs/pari/gen.pyx at line 391 is very
 improper. I mean, there is that pari instance P -- all elements are
 supposed to have an init method accepting a an argument `parent`.

 Anyway. I guess the fix for that problem will take place in the
 initialisation of the pari instance.

 By the way, building sage-4.7.2.alpha2 was shorter than I thought.
 Problem: I do ''not'' get the segfault! Is the segfault supposed to happen
 when Sage starts? Or is it in some test?

 I see that Volker already has a patch. It is a shame that I can still not
 reproduce the error, but I'll have a look at the new patch.

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