diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-07-10 16:41:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 16:41:02 (GMT) |
commit | a840806d338805fe74a9de01081d30da7605a29f (patch) | |
tree | 06f91a8b4ff44d2ed848952332e7c279de74f6e1 /Misc | |
parent | 3e23fa71f43fb225ca29a931644d1100e2f4d6b8 (diff) | |
download | cpython-a840806d338805fe74a9de01081d30da7605a29f.zip cpython-a840806d338805fe74a9de01081d30da7605a29f.tar.gz cpython-a840806d338805fe74a9de01081d30da7605a29f.tar.bz2 |
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst b/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst new file mode 100644 index 0000000..8466636 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-06-13-14-24-55.gh-issue-105227.HDL9aF.rst @@ -0,0 +1,5 @@ +The new :c:func:`PyType_GetDict` provides the dictionary for the given type +object that is normally exposed by ``cls.__dict__``. Normally it's +sufficient to use :c:member:`~PyTypeObject.tp_dict`, but for the static +builtin types :c:member:`!tp_dict` is now always ``NULL``. :c:func:`!PyType_GetDict()` +provides the correct dict object instead. |