gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)

This commit is contained in:
Petr Viktorin 2023-06-12 17:45:49 +02:00 committed by GitHub
parent 58f0bda341
commit 2b90796be6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 9 deletions

View file

@ -258,7 +258,7 @@ The following functions and structs are used to create
(or *Py_tp_base[s]* slots if *bases* is ``NULL``, see below).
Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not
supported.
supported, except if ``tp_new`` is ``NULL``.
(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