Hi Robert, > I would expect the category framework to figure out that if R is an > object > > in EuclideanDomains, then R.element_class should dynamically inherit > from > > both EuclideanDomainElement and IntegralDomainElement. > > It already does. R need not descend from EuclideanDomain, it simply > declares its category as EuclideanDomains. >
Yes, I just added this to emphasise that I do want this to happen via the category framework and not via static inheritance. > The difference between your proposal and what currently exists are > > (1) The Element[Methods] class is attached to the category's > ParentMethods, rather than the category itself > Exactly; this is what I would like to be the case. I don't propose any other changes except the ones needed to make this possible. > (2) The Element and Object method classes are required to inherit from > Element and Parent directly. I don't see what value this adds, as the > concrete R.element_class values will already have this property. > I don't think it is important whether Element and Object inherit from Element and Parent; this was just to stress that they could inherit from the same class, or none at all, for every element class. > Less importantly, I would also prefer ParentMethods to be called Object, > > ObjectClass or something similar, both because objects needn't be > parents > > and because the class in question could have other attributes that are > not > > methods. > > Yeah. Unfortunately, we have object and SageObject that mean entirely > different things. There is also CategoryObject which is a superclass > of Parent (=Object in the category of Sets). Element doesn't actually > makes sense on CategoryObject. > I agree. But it would be an attribute of Category, not a global identifier, so if one uses C.Object for a category C then it is hopefully clear that it refers to category objects, not to Sage or Python objects. C.ObjectClass would be slightly clearer in my opnion. Peter -- You received this message because you are subscribed to the Google Groups "sage-devel" 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-devel. For more options, visit https://groups.google.com/groups/opt_out.
