Skip to content

Conversation

@blhsing
Copy link
Contributor

@blhsing blhsing commented May 29, 2024

ABCMeta.__subclasscheck__ now initializes cls if it is not yet initialized

This fixes the issues reported in gh-82266, gh-116093 and gh-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.

Co-authored-by: Kirill Podoprigora <[email protected]>
@treykeown
Copy link

Wanted to +1 this, anything I can do to help it get merged?

@treykeown
Copy link

Any reason this is blocked?

@blhsing
Copy link
Contributor Author

blhsing commented Sep 18, 2024

@ncoghlan Can you help review this PR, as you were the reviewer of the original implementation of __init_subclass__? Thanks!

Made references to methods proper links in news.
@treykeown
Copy link

Hey folks - still hacking around this bug. Anything I can do to help get this moving?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants