diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/type.rst | 8 | ||||
-rw-r--r-- | Doc/whatsnew/3.10.rst | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index a822b67..a869859 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -154,9 +154,8 @@ The following functions and structs are used to create Creates and returns a heap type object from the *spec* (:const:`Py_TPFLAGS_HEAPTYPE`). - If *bases* is a tuple, the created heap type contains all types contained - in it as base types. - + The *bases* argument can be used to specify base classes; it can either + be only one class or a tuple of classes. If *bases* is ``NULL``, the *Py_tp_bases* slot is used instead. If that also is ``NULL``, the *Py_tp_base* slot is used instead. If that also is ``NULL``, the new type derives from :class:`object`. @@ -174,7 +173,8 @@ The following functions and structs are used to create .. versionchanged:: 3.10 - The function now accepts NULL ``tp_doc`` slot. + The function now accepts a single class as the *bases* argument and + ``NULL`` as the ``tp_doc`` slot. .. c:function:: PyObject* PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 16cb7ef..ce66b1d 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -512,6 +512,10 @@ New Features reference count of an object and return the object. (Contributed by Victor Stinner in :issue:`42262`.) +* The :c:func:`PyType_FromSpecWithBases` and :c:func:`PyType_FromModuleAndSpec` + functions now accept a single class as the *bases* argument. + (Contributed by Serhiy Storchaka in :issue:`42423`.) + * The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` slot. (Contributed by Hai Shi in :issue:`41832`.) |