Visitar URL original
bpo-28869: Set up inheritance registry in ABCMeta.__init__. by serhiy-storchaka · Pull Request #16613 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20250617042350/https://github.com/python/cpython/pull/16613
Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 7, 2019 •

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().

https://bugs.python.org/issue28869

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().
Copy link
Member

@ilevkivskyi ilevkivskyi left a 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.

Copy link
Member

@iritkatriel iritkatriel left a 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.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants