summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-04-28 17:02:42 (GMT)
committerGitHub <noreply@github.com>2021-04-28 17:02:42 (GMT)
commit3b52c8d66b25415f09478ab43f93d59a3547dc13 (patch)
treec403cd3e2e6601ce86b4732085f0836d278964d9 /Doc/c-api
parent3cc481b9de43c234889c8010e7da3af7c0f42319 (diff)
downloadcpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.zip
cpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.tar.gz
cpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.tar.bz2
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)
Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and modify PyType_Ready() to set it for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/typeobj.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 9efe3aa..4c75a12 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -1177,6 +1177,18 @@ and :c:type:`PyType_Type` effectively act as defaults.)
.. versionadded:: 3.10
+ .. data:: Py_TPFLAGS_IMMUTABLETYPE
+
+ This bit is set for type objects that are immutable: type attributes cannot be set nor deleted.
+
+ :c:func:`PyType_Ready` automatically applies this flag to static types.
+
+ **Inheritance:**
+
+ This flag is not inherited.
+
+ .. versionadded:: 3.10
+
.. c:member:: const char* PyTypeObject.tp_doc