mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) (GH-105697)
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386)
(cherry picked from commit 2b90796be6
)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
9e3e5d533e
commit
2eed1f5868
5 changed files with 53 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue