I don't think I said that I wanted more static inheritance. Basically, you want > > class IntegralDomainElement(Element): > ... > > class IntegralDomain(Parent): > ... > > class EuclideanDomainElement(IntegralDomainElement): > def xgcd(self, other): > ... > > class EuclideanDomain(IntegralDomain): > Element = EuclideanDomainElement > > class EuclideanDomains(IntegralDomains): > ParentMethods = EuclideanDomain > > instead of > > class EuclideanDomainElement: > def xgcd(self, other): > ... > > class EuclideanDomain: > ... > > class EuclideanDomains(IntegralDomains): > ElementMethods = EuclideanDomainElement > ParentMethods = EuclideanDomain >
No, I want class IntegralDomainElement(Element): ... class IntegralDomain(Parent): Element = IntegralDomainElement > class EuclideanDomainElement(Element): > def xgcd(self, other): > ... > class EuclideanDomain(Parent): > Element = EuclideanDomainElement > class IntegralDomains(Category_singleton): ParentMethods = IntegralDomain class EuclideanDomains(Category_singleton): ParentMethods = EuclideanDomain def super_categories(self): return [IntegralDomains()] 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. 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. -- 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.
