#11342: Make getattr faster on parents and elements
------------------------------+---------------------------------------------
Reporter: SimonKing | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: performance | Keywords: getattr parent element
Work_issues: | Upstream: N/A
Reviewer: Jeroen Demeyer | Author: Simon King
Merged: | Dependencies: #9944
------------------------------+---------------------------------------------
Comment(by SimonKing):
Replying to [comment:49 vbraun]:
> Your patch fixes the `pari_ring` segfaults and looks great!
Thank you!
> I've fixed the crash in `sage/crypto/classical_cipher.py` in the patch
that I just posted.
OK, I'll have a look (but the problem is that I can't verify that it fixes
a segfault, because I don't get a segfault.
>
> The next crash, in `sage/algebras/quatalg/quaternion_algebra.py`, is
more tricky. Ideals in quaternion algebras don't have their parent set.
The `QuaternionFractionalIdeal_rational` class derives from
`sage.ring.ideal` which assumes it is an ideal in a commutative ring, see
`sage.ring.ideal_monoid`.
Too bad. There is #11068, which introduces ''proper'' support for one- and
twosided ideals in non-commutative rings. But that comes much later in my
patch chain...
Perhaps we can use a temporary workaround: `__getattr__` could not only
test whether `self._parent._category` is None, but whether `self._parent`
is None.
Of course, any additional test will affect the performance. But perhaps it
is still acceptable? I think that would be the easiest solution, so, let's
do some tests with it.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11342#comment:50>
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.