◐ Shell
reader mode source ↗
Skip to content

bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613

Open
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:abcmeta-init
Open

bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:abcmeta-init

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

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

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide 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 iritkatriel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

This has merge conflicts so cannot be merged.

@bedevere-bot

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes stale Stale PR or inactive for long period of time. type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants