diff options
author | Hai Shi <shihai1992@gmail.com> | 2021-07-29 07:57:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 07:57:02 (GMT) |
commit | a390ebea17a96d1c93fc5f75b1e19916090a4561 (patch) | |
tree | 3780f80b1c97d14aa433260ddc039e6f5046996a /Objects | |
parent | 5269c091458c5ea76eb625e4fabc9980b6309266 (diff) | |
download | cpython-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.c | 6 |
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) { |