-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-28869: Set up inheritance registry in ABCMeta.__init__. #16613
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
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has merge conflicts so cannot be merged.
|
When you're done making the requested changes, leave the comment: |
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