#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:22 vbraun]:
 > The segfault is in the last line; is `_category` Null?
 >...
 >  *         if (name.startswith('__') and not name.endswith('_')) or
 self._parent._category is None:

 The preceding line is supposed to test whether the category of
 self._parent is initialised. If a cdef attribute is not initialised then
 it is None. At least, so it is on all computers that I worked with.

 >  *             raise AttributeError, AttributeErrorMessage(self, name)
 >  *         return getattr_from_other_class(self,
 self._parent._category.element_class, name)             # <<<<<<<<<<<<<<

 And IF self._parent._category is not None then it has an element_class.

 Very strange.

 I just verified that on my machine and with sage-4.7.1.rc2 I do ''not''
 get the segfault, even without #9138. So, I should definitely build
 sage-4.7.2.alpha1.

 Cheers,
 Simon

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