Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
I came to the same conclusion after trying to fix it. But we cannot just do it now. We have to fix bugs in Python 3.9 and support protocols 0 and 1 for some deprecation period. Also protocols 0 and 1 are used in some third-party implementations for other programming languages, so they can be used for interoperability with other languages. The proposed patch adds additional check. It uses the fact that the __new__ attribute for classes implemented in C is a bultin function with __self__ pointing to this class (it is created in tp_new_wrapper()). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41052> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com