Skip to content

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