Hi Jeroen, On 2016-10-10, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote: > Try this: > > sage: from sage.misc.inherit_comparison import > InheritComparisonClasscallMetaclass > sage: class A(Element, UniqueRepresentation): > ....: __metaclass__ = InheritComparisonClasscallMetaclass
In other words, we have custom made metaclasses that combine various "basic" metaclasses. Such as DynamicInheritComparisonClasscallMetaclass found in sage.structure.dynamic_class: It combines DynamicMetaclass, InheritComparisonMetaclass and ClasscallMetaclass, and if I see that correctly it fails to include NestedClassMetaclass (which is a sub-metaclass of ClasscallMetaclass for a mere technical reason). Several years ago, I played with the idea to have certain atomic metaclasses for Sage, each of which implementing just a single feature. And to be able to automatically combine them, the atomic metaclasses are instances of a common meta-metaclass: The meta-metaclass would take the atomic metaclasses appearing in the bases of a class definition "Foo", and would automatically/dynamically create a composed metaclass, that combines all the features of the given atomic metaclasses and would serve as the metaclass of the resulting class "Foo". In other words, there would be no need to hard-code DynamicInheritComparisonClasscallMetaclass in SageMath: The meta-metaclass would dynamically create it from DynamicMetaclass, InheritComarisonMetaclass, and ClasscallMetaclass. I had a proof of concept, at a time when SageMath used less metaclasses than it does now. Do you think it would find support from the SageMath community to revive my project to sanitise metaclass usage? The more SageMath is relying on metaclasses, the more I feel it makes sense to structure it by means of a meta-metaclass. Best regards, Simon -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.