#11943: The category graph should comply with Python's method resolution order
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_review
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 mderickx):
I think base has nothing to do with join logically so I think it is a bad
idea to only add it to joins of categories for this shortcut purpose. Also
I don't like your 'base' concept since it is just a speedup thing right
now and doesn't relate to something wich has a real mathematical meaning.
The second thing is that I don't like the way how the code is organized
right now in is_subclass. The reason for this is that this way of making
shortcuts scales very bad and that other people thinking of other specific
shortcuts to speed stuff up might make this a very cluttered method very
soon. I'd say its cluttered already since this generic method already has
special code for categories witch are a join of something and special code
for the case that self and other have a base method. I think it is better
to provide a truly generic implementation in combination with something
like a __subclasshook__ as python has for Abstract Base Classes
http://docs.python.org/library/abc.html#abc.ABCMeta.__subclasshook__ . In
this way you we can have the JoinCategory specific code where it belongs
and you can have your "base" optimisation in the place where it belongs,
and other people can add their own shortcuts as they please.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11943#comment:25>
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.