#11943: The category graph should comply with Python's method resolution order
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.8
Component: categories | Keywords: category graph, method resolution
order
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #11900
---------------------------+------------------------------------------------
Comment(by SimonKing):
Replying to [comment:25 mderickx]:
> I think base has nothing to do with join logically
I think it does, to some extent. If C is a category with a base B, then
all its objects are supposed to have this base B as well. If you form a
join J of C with another category, then all objects of J are also objects
of C and thus have the base B.
It only starts to lack logic if you join categories with distinct bases.
But if you join a list of categories such that at least one of them has
base B and all other categories on the list either have no base at all or
have the base B as well, then I think it is alright to say that the join
has base B.
> The second thing is that I don't like the way how the code is organized
right now in is_subclass. ... I think it is better to provide a truly
generic implementation in combination with something like a
`__subclasshook__`
One could argue that `super_categories()` alreay plays the role of
`__subclasshook__`: It determines how different categories are contained
in one another, and is used in a generic method `Category.is_subcategory`.
But I agree that it is conceivable that `JoinCategory` or
`Category_over_base` could benefit from using a specialised method for
detecting subcategories.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11943#comment:27>
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.