Message230189
It is possible to get a partially initialized class from inside a custom mro(). And extending such type results in passing NULL to PySequence_List inside mro_implementation, which in turn leads to PyErr_BadInternalCall. #22735 has a test reproducing it (http://bugs.python.org/file37036) and a corresponding fix of mro_implementation (http://bugs.python.org/file37038).
However, I'm not sure that the proper way is to call PyType_Ready on each uninitialized class from tp_bases. In particular, the test case from the link above would end up with infinite recursion (PyType_Ready(cls) -> mro(cls) -> class X(cls): ... -> PyType_Ready(X) -> PyType_Ready(cls) -> ...). Moreover, whether a type is initialized or not is determized by checking its tp_dict, which is initialized before filling in tp_mro, so that may be the test above is not the case of Roger. |
|
Date |
User |
Action |
Args |
2014-10-28 23:59:51 | abusalimov | set | recipients:
+ abusalimov, ronaldoussoren, amaury.forgeotdarc, belopolsky, rupole, benjamin.peterson |
2014-10-28 23:59:51 | abusalimov | set | messageid: <1414540791.34.0.0323920989092.issue3453@psf.upfronthosting.co.za> |
2014-10-28 23:59:51 | abusalimov | link | issue3453 messages |
2014-10-28 23:59:51 | abusalimov | create | |
|