Howdy!

On 2013-10-18, Robert Bradshaw <rober...@math.washington.edu> wrote:
> It's a little more subtle than that. The underlying restriction is
> that one can't have multiple inheritance of classes whose C members
> (including cdef methods) are incompatible.

A little remainder: There are cases of classes whose C members are
considered to be *compatible* (e.g., sage.categories.maps.Map and
sage.structure.element.ModuleElement or RingElement, I don't recall
which), but when one creates a python class inheriting from both
extension classes, then in fact the C members of the two bases may get
confused.

> On that note, I have been looking at exposing C function pointers at
> runtime, which would avoid the Python calling overhead and allow
> passing of primitive types without the need for compile-time
> declarations or fixed layouts.

I don't know the internals of GAP very well. But someone has told me
that GAP chooses functions according to what it has discovered about a
specific object (hence, it can change over time), and it does so with C
speed. Is GAP's method similar to what you suggest here?

>> - explore the cythonization of category methods

In UniqueRepresentation, we have to use a Python class because it uses a
metaclass, but in addition we inherit from an extension class, which
provides equality test and hash with Cython speed.

Now I wonder why you said "*explore* the cythonization". Wouldn't it be
easily possible to proceed as with UniqueRepresentation, and create
extension classes that are then mixed into the element and parent
classes of the categories? Wouldn't this be the natural place to feed
the *Element and the Cythoned Parent classes into the category
framework? Modulo the incompatibility I mentioned above, of course.

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to