]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Thu, 13 May 2021 22:44:55 +0000 (00:44 +0200)
committerGitHub <noreply@github.com>
Thu, 13 May 2021 22:44:55 +0000 (15:44 -0700)
Doc/whatsnew/3.10.rst

index 2d11efba4d0122030d8563045f9672ccca430180..9394ee7d6223ba4f64623b8cfbc9bb6df9740c04 100644 (file)
@@ -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
 ----------