Phillip J. Eby wrote:
> In other words, a class' metaclass has to be a derivative of all its
> bases' metaclasses; ISTM that a __prepare__ namespace needs to be a
> derivative in some sense of all its bases' __prepare__ results. This
> probably isn't enforceable, but the pattern should be documented such
> that e.g. the overloading metaclass' __prepare__ would return a
> mapping that delegates operations to the mapping returned by its
> super()'s __prepare__, and the actual class creation would be
> similarly chained. PEP 3115 probably needs a section to explain
> these issues and recommend best practices for implementing
> __prepare__ and class creation on that basis. I'll write something
> up after I've thought this through some more.
A variant of the metaclass rule specific to __prepare__ might look
something like:
A class's metaclass providing the __prepare__ method must be a
subclass of all of the class's base classes providing __prepare__ methods.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com