summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorWenzel Jakob <wenzel.jakob@epfl.ch>2022-05-27 08:27:39 (GMT)
committerGitHub <noreply@github.com>2022-05-27 08:27:39 (GMT)
commit5e34b494a08015e9b5a3deade23943bdba284a93 (patch)
tree829c824df2d307b14d0cf9efc51e2bbfcca92589 /Include/object.h
parent20d30ba2ccf9182e4f08db112f428c909148a40b (diff)
downloadcpython-5e34b494a08015e9b5a3deade23943bdba284a93.zip
cpython-5e34b494a08015e9b5a3deade23943bdba284a93.tar.gz
cpython-5e34b494a08015e9b5a3deade23943bdba284a93.tar.bz2
gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)
Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index f01b9fa..a3c6bd4 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -257,6 +257,9 @@ PyAPI_FUNC(void *) PyType_GetModuleState(PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GetName(PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GetQualName(PyTypeObject *);
#endif
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
+PyAPI_FUNC(PyObject *) PyType_FromMetaclass(PyTypeObject*, PyObject*, PyType_Spec*, PyObject*);
+#endif
/* Generic type check */
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);