New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() #29048
Conversation
|
Thanks @sweeneyde for the PR, and @gpshead for merging it |
* Use Py_EnterRecursiveCall() in issubclass() Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google] (cherry picked from commit 423fa1c) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
GH-29175 is a backport of this pull request to the 3.10 branch. |
|
Thanks @sweeneyde for the PR, and @gpshead for merging it |
|
GH-29178 is a backport of this pull request to the 3.9 branch. |
* Use Py_EnterRecursiveCall() in issubclass() Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google] (cherry picked from commit 423fa1c) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|


This is an alternative to GH-29017. This shouldn't affect performance too much because the recursion checks only occur once for each time a length>=2
__bases__tuple is found (i.e. for multiple inheritance). Note that if we get stuck in thewhile (1) {...}loop, as long as the pathological__bases__implementation is in Python, we can still interrupt with a KeyboardInterrupt.https://bugs.python.org/issue30570