Daniel Urban <urban.dani...@gmail.com> added the comment:

Okay, probably the check in my previous patch was too strict (sorry for the 
noise).  I'm attaching an updated patch again.  Now the algorithm in 
__build_class__ is this:

1. If an object is explicitly given with the metaclass keyword, that is the 
"starting metaclass".
2. Else if there are bases, the type of the first base is the starting 
metaclass (note, that this possibly will be replaced later, but before the 
__prepare__ call).
3. Else the starting metaclass is type.

4. If the starting metaclass is a class, do the metaclass calculation, so the 
starting metaclass may be replaced with its most derived descendant.
5. Else we cannot do the metaclass calculation, so use the starting metaclass 
as is.

There are also tests for these cases, and the example in msg134256 now works 
too.

----------
Added file: http://bugs.python.org/file21755/issue11256_4.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1294232>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to