#11115: Rewrite cached_method in Cython
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: jason
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: misc | Keywords: category cython cache
Author: Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Comment(by SimonKing):
Replying to [comment:5 novoselt]:
> ...
> What exactly is the problem with double inheritance? It would be nice if
all `SageObjects` had a fast uniform cache...
The problem is that you can not have double inheritance from extension
classes if Python does not know whether the underlying data structures are
compatible. So, if you have
{{{
cdef class SageObject:
pass
}}}
(which is currently the case) then it is fine, such as here:
{{{
sage: cython('cdef class MySimpleObject: pass')
sage: class C(list,MySimpleObject): pass
....:
}}}
But you get an error if you want to put more structure in it
{{{
sage: cython('''cdef class MyObject:
....: cdef dict __cached_methods
....: ''')
sage: class C(list,MyObject): pass
....:
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/mnt/local/king/SAGE/broken/devel/sage-main/<ipython console> in
<module>()
TypeError: Error when calling the metaclass bases
multiple bases have instance lay-out conflict
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11115#comment:6>
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.