diff options
author | Hai Shi <shihai1992@gmail.com> | 2021-08-17 13:39:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 13:39:34 (GMT) |
commit | 3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f (patch) | |
tree | be4a37d2598016830e499dd7fb45b75fea71b1e9 /Doc | |
parent | 6a358bb9482f7595b858ea7b800cbe66f0de5fa1 (diff) | |
download | cpython-3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f.zip cpython-3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f.tar.gz cpython-3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f.tar.bz2 |
bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/type.rst | 7 | ||||
-rw-r--r-- | Doc/data/refcounts.dat | 3 | ||||
-rw-r--r-- | Doc/data/stable_abi.dat | 1 | ||||
-rw-r--r-- | Doc/whatsnew/3.11.rst | 3 |
4 files changed, 14 insertions, 0 deletions
diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 630c7db..413294d 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -112,6 +112,13 @@ Type Objects .. versionadded:: 3.11 +.. c:function:: PyObject* PyType_GetQualName(PyTypeObject *type) + + Return the type's qualified name. Equivalent to getting the + type's ``__qualname__`` attribute. + + .. versionadded:: 3.11 + .. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot) Return the function pointer stored in the given slot. If the diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 9b5c005..3ef1b28 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -2310,6 +2310,9 @@ PyType_GetFlags:PyTypeObject*:type:0: PyType_GetName:PyObject*::+1: PyType_GetName:PyTypeObject*:type:0: +PyType_GetQualName:PyObject*::+1: +PyType_GetQualName:PyTypeObject*:type:0: + PyType_GetSlot:void*::: PyType_GetSlot:PyTypeObject*:type:0: PyType_GetSlot:int:slot:: diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 4938459..ea57cc8 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -644,6 +644,7 @@ function,PyType_GetFlags,3.2, function,PyType_GetModule,3.10, function,PyType_GetModuleState,3.10, function,PyType_GetName,3.11, +function,PyType_GetQualName,3.11, function,PyType_GetSlot,3.4, function,PyType_IsSubtype,3.2, function,PyType_Modified,3.2, diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 88b6f8f..c546ec0 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -298,6 +298,9 @@ C API Changes * Add a new :c:func:`PyType_GetName` function to get type's short name. (Contributed by Hai Shi in :issue:`42035`.) +* Add a new :c:func:`PyType_GetQualName` function to get type's qualified name. + (Contributed by Hai Shi in :issue:`42035`.) + New Features ------------ |