#12876: Fix element and parent classes of Hom categories to be abstract, and
simplify the Hom logic.
----------------------------------------------------------------+-----------
Reporter: nthiery |
Owner: nthiery
Type: enhancement |
Status: needs_work
Priority: major |
Milestone: sage-pending
Component: categories |
Resolution:
Keywords: categories, Hom | Work
issues: needs rebase
Report Upstream: N/A |
Reviewers: Simon King
Authors: Nicolas M. ThiƩry | Merged
in:
Dependencies: #715, #11521, #12215, #12313, #13412. #13145 |
Stopgaps:
----------------------------------------------------------------+-----------
Comment (by nthiery):
I just uploaded a rebased patch. This patch sounds almost good to go.
Still, there are a couple failing tests which all boil to the following
little design issue:
Take as typical situation A to be Rings().parent_class, and B to be some
NumberField parent class. Assume that P is an instance of A resp. B and
that:
- A implements _Hom_ so that P._Hom_(codomain) is a RingHomset if codomain
is a ring
- B implements _Hom_ so that P._Hom_(codomain) is a NumberFieldHomset if
codomain is a NumberField
Let P be an instance of B and codomain a ring. With the current logic
Hom(P, codomain) will
try the later, which will fail, but won't proceed to try the former. So
the result will be a plain Homset, and not a RingHomset as desired.
For some reasons this situation did not appear a year ago. Presumably some
tests were added in the mean time. Or we did not run the tests with --long
...
What's the best way out?
- Option 1: Walk the mro of the class of P, and call cls._Hom_(P,
codomain) in turn until something does not fail
- Option 2: change the protocol so that the _Hom_ method should call super
instead of failing if they cannot handle the situation
- Option 3: ???
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12876#comment:105>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.