#11935: Make parent/element classes independent of base rings
------------------------------------------------------------------+---------
Reporter: SimonKing |
Owner:
Type: enhancement |
Status: needs_work
Priority: major |
Milestone: sage-5.10
Component: categories |
Resolution:
Keywords: parent class, element class, category | Work
issues:
Report Upstream: N/A |
Reviewers: Nicolas Thiery, Travis Scrimshaw
Authors: Simon King | Merged
in:
Dependencies: #9138, #11900, #11943, #12875, #12876, #12877 |
Stopgaps:
------------------------------------------------------------------+---------
Comment (by nthiery):
Replying to [comment:107 SimonKing]:
> I don't see how multiple inheritance comes into play. What we want
> is to override the attribute `__class__` of an instance. That's
> possible in Python, but impossible in Cython, and I don't think this
> can ever change. So, it is ''not'' an option to use
> `_initalise_category_` to enrich the class of a homset H, if
> `H.__class__` is a cython class.
That's to be discussed with Robert, but I am pretty sure there will be
a way out if we don't think too much in the box. Anyway, let's not worry
about that for now.
> But what we ''can'' do, if I am not mistaken: Create a dynamic class
> that is constructed from one concrete base class (which can be a
> cythoned Homset, for example) and an abstract class (which can be
> `C.hom_category().parent_class`). And then we could create `H` as an
> instance of this dynamic class.
A quick way being to define Homset as a Python subclass of the
cythonized Homset. And the _initialize_category_ will do that for you.
> Really? So, how does the abstract class comes into play, then?
Homset is a parent like all the others, and inherit code from its
categories (in that case a Homcategory).
> I guess I should look at the patch...
Please!
> No, in the location I stated. It is:
> {{{
> sage: sage.categories.rings.Rings.HomCategory.ParentMethods.__new__??
Oh, right, I had forgotten about this one. This is gone with the
patch; which is why I did not find it :-)
And if I was able to get rid of it, I don't see why this would not be
the case for schemes as well.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11935#comment:108>
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.