Skip to content

Commit 3222b25

Browse files
[3.10] bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) (GH-26115)
(cherry picked from commit a09fc9c) Co-authored-by: Erlend Egeberg Aasland <[email protected]> Automerge-Triggered-By: GH:gvanrossum
1 parent 2d78023 commit 3222b25

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/whatsnew/3.10.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,10 @@ New Features
18381838
creating type instances.
18391839
(Contributed by Victor Stinner in :issue:`43916`.)
18401840
1841+
* Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating immutable
1842+
type objects: type attributes cannot be set nor deleted.
1843+
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
1844+
18411845
Porting to Python 3.10
18421846
----------------------
18431847
@@ -1895,6 +1899,12 @@ Porting to Python 3.10
18951899
been included directly, consider including ``Python.h`` instead.
18961900
(Contributed by Nicholas Sim in :issue:`35134`)
18971901
1902+
* Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable type
1903+
objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a type
1904+
object is mutable or not; check if :c:data:`Py_TPFLAGS_IMMUTABLETYPE` is set
1905+
instead.
1906+
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
1907+
18981908
Deprecated
18991909
----------
19001910

0 commit comments

Comments
 (0)