summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-05-13 22:44:55 (GMT)
committerGitHub <noreply@github.com>2021-05-13 22:44:55 (GMT)
commita09fc9c63f1b5980c62ff2712f67500bacb92b04 (patch)
treed9caec8b414a8ee4eec11a4ea9b60b3bb1da9c44
parent4aeee0b47b3a2b604bbac37040320ffc88c291f2 (diff)
downloadcpython-a09fc9c63f1b5980c62ff2712f67500bacb92b04.zip
cpython-a09fc9c63f1b5980c62ff2712f67500bacb92b04.tar.gz
cpython-a09fc9c63f1b5980c62ff2712f67500bacb92b04.tar.bz2
bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816)
-rw-r--r--Doc/whatsnew/3.10.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 2d11efb..9394ee7 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -1846,6 +1846,10 @@ New Features
creating type instances.
(Contributed by Victor Stinner in :issue:`43916`.)
+* Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating immutable
+ type objects: type attributes cannot be set nor deleted.
+ (Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
+
Porting to Python 3.10
----------------------
@@ -1903,6 +1907,12 @@ Porting to Python 3.10
been included directly, consider including ``Python.h`` instead.
(Contributed by Nicholas Sim in :issue:`35134`)
+* Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable type
+ objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a type
+ object is mutable or not; check if :c:data:`Py_TPFLAGS_IMMUTABLETYPE` is set
+ instead.
+ (Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
+
Deprecated
----------