summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-10 17:12:15 (GMT)
committerGitHub <noreply@github.com>2023-07-10 17:12:15 (GMT)
commit41057b2ffeb5a8cb492e37e5503ab76ed1a3082d (patch)
treec59a7fc218fccc6dcc1607bef0d3302f4801486c /Misc
parent0481b805d6631063887fcbcc27684aa8a2576fae (diff)
downloadcpython-41057b2ffeb5a8cb492e37e5503ab76ed1a3082d.zip
cpython-41057b2ffeb5a8cb492e37e5503ab76ed1a3082d.tar.gz
cpython-41057b2ffeb5a8cb492e37e5503ab76ed1a3082d.tar.bz2
[3.12] gh-105227: Add PyType_GetDict() (GH-105747) (#106600)
gh-105227: Add PyType_GetDict() (GH-105747) This compensates for static builtin types having `tp_dict` set to `NULL`. (cherry picked from commit a840806d338805fe74a9de01081d30da7605a29f) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> 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.rst5
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.