bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613
bpo-28869: Set up inheritance registry in ABCMeta.__init__.#16613serhiy-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
left a comment
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.
Sorry, something went wrong.
iritkatriel
left a comment
There was a problem hiding this comment.
This has merge conflicts so cannot be merged.
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
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