-
-
Couldn't load subscription status.
- Fork 33.2k
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 our terms of service and privacy 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?
Conversation
…is not already initialized
Co-authored-by: Kirill Podoprigora <[email protected]>
|
Wanted to +1 this, anything I can do to help it get merged? |
|
Any reason this is blocked? |
|
@ncoghlan Can you help review this PR, as you were the reviewer of the original implementation of |
Made references to methods proper links in news.
|
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 in gh-82266, gh-116093 and gh-119699.
Previously calling
issubclasswithin__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.