This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients amaury.forgeotdarc, benjamin.peterson, daniel.urban, georg.brandl, gvanrossum, ncoghlan, pwerneck, rodsenra, terry.reedy
Date 2011-04-19.14:03:32
SpamBayes Score 2.60909e-10
Marked as misclassified No
Message-id <>
Sorry, my last review wasn't right and the patch is incorrect as it stands. After digging a little deeper, there is still a case that isn't covered correctly in __build_class__.

Specifically, the case where the most derived class has a declared metatype that is the *parent* of the metaclass that *should* be used.

This can be seen in type_new, where it does the "if (winner != metatype)" check. There is no equivalent check in __build_class__ - instead, the explicitly declared metaclass always wins.

What needs to happen is that the call to _PyType_CalculateMetaclass in __build_class__ should be moved out so that it is unconditional. The passed in metatype will either by the explicitly declared one (if it exists) or else PyType_Type. An additional test to pick up this case is also needed.
Date User Action Args
2011-04-19 14:03:33ncoghlansetrecipients: + ncoghlan, gvanrossum, georg.brandl, terry.reedy, amaury.forgeotdarc, rodsenra, pwerneck, benjamin.peterson, daniel.urban
2011-04-19 14:03:33ncoghlansetmessageid: <>
2011-04-19 14:03:33ncoghlanlinkissue1294232 messages
2011-04-19 14:03:32ncoghlancreate