Serhiy Storchaka added the comment:

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):
    pass

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.

----------
keywords:  -patch

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

Reply via email to