On Sun, Sep 11, 2011 at 04:07:39PM -0700, Simon King wrote: > I found some comments stating that the current use of metaclasses in > Sage is not very scalable.
That probably was from me. > I guess that shall be understood as "things get messy if one puts a > new metaclass on top of existing (and different) metaclasses of the > base classes". It seems to me that the approach to dynamically > create new metaclasses from old would be better scalable. Yes: if a class inherit from others, then the inheritance diagram between their metaclasses should be compatible. So if one wants to create a new class C inheriting from A and B, then one may need to create a new metaclass MC inheriting from those MA and MB of A and B. To limit the risks, I tried so far to keep the hierarchy of metaclasses as small as possible. Designing an automatic/dynamic way to handle such situations as you suggest could make sense. But the ``Keep it simple'' principle calls for only going this way if we start having really non trivial needs for metaclasses. What does your FastHashMetaclass do precisely? Could we just throw the feature in ClasscallMetaclass? This could be a good occasion to find a more appropriate name for this metaclass. Speaking of which: ClasscallMetaclass and UniqueRepresentation would deserve to be cythoned at some point. With the upcoming super fast cached functions, we would then get super fast unique representation. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org