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 serhiy.storchaka
Recipients eric.smith, gvanrossum, serhiy.storchaka, terry.reedy, ztane
Date 2016-05-06.20:09:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There is one test (ClassPropertiesAndMethods.test_mutable_bases_with_failing_mro in test_descr) that crashes with the code from issue551412 because _PyType_Lookup() is recursive called from PyType_Ready(). Is this the reason? My patch prevents recursive calls.

Here is minimal example (for Python 3):

class M(type):
    def mro(self):
        hasattr(self, 'foo')
        return type.mro(self)

class C(metaclass=M):

When class C is created, C.mro() is called while C still is not ready. Resolving an attribute calls _PyType_Lookup() which calls PyType_Ready() which calls mro() etc.
Date User Action Args
2016-05-06 20:09:09serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, terry.reedy, eric.smith, ztane
2016-05-06 20:09:08serhiy.storchakasetmessageid: <>
2016-05-06 20:09:08serhiy.storchakalinkissue26906 messages
2016-05-06 20:09:08serhiy.storchakacreate