summaryrefslogtreecommitdiffstats
path: root/Objects
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 /Objects
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 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 43b4d07..2240f78 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3628,6 +3628,12 @@ PyType_FromSpec(PyType_Spec *spec)
return PyType_FromSpecWithBases(spec, NULL);
}
+PyObject *
+PyType_GetName(PyTypeObject *type)
+{
+ return type_name(type, NULL);
+}
+
void *
PyType_GetSlot(PyTypeObject *type, int slot)
{