#10667: Morphisms and Objects of Categories
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: categories | Keywords: objects morphisms containment
Work_issues: doctests | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #9138, #11115
---------------------------+------------------------------------------------
Comment(by nthiery):
Replying to [comment:16 SimonKing]:
> It is a very bad error, and I don't know at which point I introduced it.
It is about incompatible method resolution orders:
> {{{
> sage: class Foo(Homset, Objects().HomCategory(Objects()).parent_class):
pass
> order (MRO) for bases Homset, Objects.HomCategory.parent_class
> }}}
Yeah, this kind of error can be quite tricky indeed. This is the very
technical bit where I am bit uneasy about the future scaling of
categories using dynamic classes. The only way to avoid such errors
sanely is to specify general rules about the order of the base classes
of a class. There are very minimal comments about that at the end of
the primer. Reducing the risk of this kind of issue is also one of the
goal of #10963 (the more is done automatically, the higher are the
chances of consistency).
> It seems that the problem is in the order in which the two classes are
presented:
> {{{
> sage: class Foo(Objects().HomCategory(Objects()).parent_class, Homset):
pass
> ....:
> sage:
> }}}
Here, I would say that the rule is that category code (in particular
what comes from a_category.parent_class) should always come after
concrete classes.
Good luck!
By the way: congrats on all your category optimization work. I love it!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10667#comment:17>
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.