From 3222b25b2f55d3b3d1dab4547bf7b5adaa1d874f Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 13 May 2021 16:04:15 -0700 Subject: [PATCH] [3.10] bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) (GH-26115) (cherry picked from commit a09fc9c63f1b5980c62ff2712f67500bacb92b04) Co-authored-by: Erlend Egeberg Aasland Automerge-Triggered-By: GH:gvanrossum --- Doc/whatsnew/3.10.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index b0920294572b..8fd64f86b3a2 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1838,6 +1838,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 ---------------------- @@ -1895,6 +1899,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 ---------- -- 2.47.3