Skip to content
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

gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. #103972

Merged
merged 4 commits into from
May 3, 2023

Conversation

encukou
Copy link
Member

@encukou encukou commented Apr 28, 2023

(That's a mouthful of an edge case!)

…stom tp_new.

(That's a mouthful of an edge case!)
Doc/whatsnew/3.12.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.12.rst Outdated Show resolved Hide resolved
Comment on lines +262 to +265
(For backwards compatibility, other ``PyType_From*`` functions allow
such metaclasses. They ignore ``tp_new``, which may result in incomplete
initialization. This is deprecated and in Python 3.14+ such metaclasses will
not be supported.)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be nested in a .. deprecated:: 3.12 block I suppose? And below.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's mentioned in .. versionchanged:: 3.12 in the affected functions.
Their docs are just Equivalent to ``PyType_FromMetaclass(NULL, NULL, arg, NULL, NULL)`` and a bunch of change notes, so the PyType_FromMetaclass docs need this parenthetical to be complete.

Objects/typeobject.c Show resolved Hide resolved
Objects/typeobject.c Show resolved Hide resolved
@encukou
Copy link
Member Author

encukou commented May 3, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants