Skip to content

Commit a09fc9c

Browse files
author
Erlend Egeberg Aasland
authored
bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816)
1 parent 4aeee0b commit a09fc9c

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
@@ -1846,6 +1846,10 @@ New Features
18461846
creating type instances.
18471847
(Contributed by Victor Stinner in :issue:`43916`.)
18481848
1849+
* Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating immutable
1850+
type objects: type attributes cannot be set nor deleted.
1851+
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
1852+
18491853
Porting to Python 3.10
18501854
----------------------
18511855
@@ -1903,6 +1907,12 @@ Porting to Python 3.10
19031907
been included directly, consider including ``Python.h`` instead.
19041908
(Contributed by Nicholas Sim in :issue:`35134`)
19051909
1910+
* Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable type
1911+
objects. Do not rely on :c:data:`Py_TPFLAGS_HEAPTYPE` to decide if a type
1912+
object is mutable or not; check if :c:data:`Py_TPFLAGS_IMMUTABLETYPE` is set
1913+
instead.
1914+
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
1915+
19061916
Deprecated
19071917
----------
19081918

0 commit comments

Comments
 (0)