bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613
Open
serhiy-storchaka wants to merge 3 commits into
Open
bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613serhiy-storchaka wants to merge 3 commits into
serhiy-storchaka wants to merge 3 commits into
Conversation
Move setting up inheritance registry from ABCMeta.__new__ to ABCMeta.__init__. This makes the __module__ attribute be properly set for types created by calling ABCMeta().
ilevkivskyi
approved these changes
Oct 7, 2019
ilevkivskyi
left a comment
Member
There was a problem hiding this comment.
This is strictly speaking not 100% backwards compatible change. Some subclasses of ABCMeta may override __new__ and may depend on the fact that abstract status and/or caches are ready after calling super().__new__(...) (IIRC this was the situation with typing.GenericMeta at some point when it existed).
So I would not backport this to older versions (also maybe this behaviour should be clarified in the docs), otherwise looks good.
iritkatriel
requested changes
Nov 7, 2022
iritkatriel
left a comment
Member
There was a problem hiding this comment.
This has merge conflicts so cannot be merged.
|
When you're done making the requested changes, leave the comment: |
|
This PR is stale because it has been open for 30 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move setting up inheritance registry from
ABCMeta.__new__toABCMeta.__init__.This makes the
__module__attribute be properly set for typescreated by calling
ABCMeta().https://bugs.python.org/issue28869