summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2021-07-29 07:57:02 (GMT)
committerGitHub <noreply@github.com>2021-07-29 07:57:02 (GMT)
commita390ebea17a96d1c93fc5f75b1e19916090a4561 (patch)
tree3780f80b1c97d14aa433260ddc039e6f5046996a /Include
parent5269c091458c5ea76eb625e4fabc9980b6309266 (diff)
downloadcpython-a390ebea17a96d1c93fc5f75b1e19916090a4561.zip
cpython-a390ebea17a96d1c93fc5f75b1e19916090a4561.tar.gz
cpython-a390ebea17a96d1c93fc5f75b1e19916090a4561.tar.bz2
bpo-42035: Add a PyType_GetName() to get type's short name. (GH-23903)
Diffstat (limited to 'Include')
-rw-r--r--Include/object.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index 9e6a8f4..23ebad8 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -239,6 +239,9 @@ PyAPI_FUNC(PyObject*) PyType_FromModuleAndSpec(PyObject *, PyType_Spec *, PyObje
PyAPI_FUNC(PyObject *) PyType_GetModule(struct _typeobject *);
PyAPI_FUNC(void *) PyType_GetModuleState(struct _typeobject *);
#endif
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030B0000
+PyAPI_FUNC(PyObject *) PyType_GetName(PyTypeObject *);
+#endif
/* Generic type check */
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);