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

PyType_From*: Disallow metaclasses with custom tp_new #123909

Closed
encukou opened this issue Sep 10, 2024 · 0 comments
Closed

PyType_From*: Disallow metaclasses with custom tp_new #123909

encukou opened this issue Sep 10, 2024 · 0 comments
Assignees

Comments

@encukou
Copy link
Member

encukou commented Sep 10, 2024

Following up after #60074 and #103968:
In 3.14, the deprecation period is over and PyType_From* should fail if the metaclass has custom tp_new. That means the tp_new is no longer silently skipped.

The proper way to instantiate such a metaclass is to call it.

Linked PRs

@encukou encukou self-assigned this Sep 10, 2024
@encukou encukou closed this as completed Sep 13, 2024
encukou added a commit to encukou/cpython that referenced this issue Mar 20, 2025
Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.
encukou added a commit that referenced this issue Mar 24, 2025
Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 1, 2025
…ythonGH-131506)

Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant