Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-116093: ABCMeta.__subclasscheck__ now initializes cls if it is not yet initialized#119719
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…is not already initialized
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
treykeown commentedJun 17, 2024
Wanted to +1 this, anything I can do to help it get merged? |
treykeown commentedSep 17, 2024
Any reason this is blocked? |
@ncoghlan Can you help review this PR, as you were the reviewer of theoriginal implementation of |
Made references to methods proper links in news.
treykeown commentedMar 26, 2025
Hey folks - still hacking around this bug. Anything I can do to help get this moving? |
ABCMeta.__subclasscheck__
now initializes cls if it is not yet initializedThis fixes the issues reported ingh-82266,gh-116093 andgh-119699.
Previously calling
issubclass
within__init_subclass__
may result in the ABC cache of the parent class of the subclass being instantiated to be mutated since the cache of the subclass is not yet initialized.This is fixed by forcing
__subclasscheck__
to initialize the current class if it is found to not have been initialized.