Serhiy Storchaka added the comment: An alternative way is just call PyType_Ready from _PyType_Lookup if type->tp_mro is NULL.
Here is a patch against 2.7 that restores the solution from issue551412, but returns NULL if type->tp_mro is still NULL after calling PyType_Ready. I found one place in tests when this is happened (CIOTest.test_IOBase_finalize in test_io). ---------- assignee: -> gvanrossum nosy: +gvanrossum Added file: http://bugs.python.org/file42717/init_type_in_pytype_lookup.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