Hi Simon!

On Fri, Mar 01, 2013 at 02:50:17PM +0000, Simon King wrote:
> On 2013-03-01, Simon King <simon.k...@uni-jena.de> wrote:
> > Is there a reason why the
> > transition to Cython should be difficult? Note that @lazy_attribute
> > and @cached_method became available to .pyx files, if I am not mistaken.
> > So, if such decorators where the only original reason to use Python, then
> > I certainly think one should try Cython now.

In principle +1 on cythoning homset.py. Note: homset.py is mostly
pre-categories code written by non-combinat people; we want them to be
involved in the discussion as they would have more insight.

> One problem arises: If one turns sage.categories.homset.Homset (and
> its base class Set_generic) into a cdef class with cdef attributes
> _domain and _codomain, then one has trouble in
> sage.modular.abvar.homspace.EndomorphismSubring: It wants to inherit
> from both sage.categories.homset.HomsetWithBase and
> sage.rings.ring.Ring---but the two base classes are incompatible.
> 
> Do you have any idea how to circumvent this problem without too much
> code duplication? Or is avoiding cdef attributes _domain and _codomain
> the only possibility (but this *would* work!)?

In an ideal world, Ring (an abstract class) would just not exist; all
the features would be provided by the Rings() category. In a slightly
imperfect world where categories can't yet provide full-speed Cython
method, Ring still has a reason to be, namely to provide some
speed-critical methods (but nothing else). In our current world, not
all speed-critical methods have been moved from Ring to Rings.

Altogether, I would aim toward having EndomorphismSubring only inherit
from the concrete class HomsetWithBase, unless it *really* needs some
of the speed critical methods of Ring. Or unless, in the short run, it
depends too much from stuff in Ring that has not yet been moved up,
and moving that stuff up would be too much hassle.

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

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


Reply via email to