#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 vbraun):
The segfault is in the last line; is `_category` Null?
{{{
#!c
/* "sage/structure/element.pyx":328
* if (name.startswith('__') and not name.endswith('_')) or
self._parent._category is None:
* raise AttributeError, AttributeErrorMessage(self, name)
* return getattr_from_other_class(self,
self._parent._category.element_class, name) # <<<<<<<<<<<<<<
*
* def __dir__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_8); if
(unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328;
__pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyObject_GetAttr(((struct
__pyx_obj_4sage_9structure_7element_Element
*)__pyx_v_self)->_parent->__pyx_base._category, __pyx_n_s__element_class);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno =
328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11342#comment:22>
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.