[Python-checkins] gh-95914: Add What's New item describing PEP 670 changes (GH-98315)

miss-islington webhook-mailer at python.org
Mon Oct 17 15:25:24 EDT 2022


https://github.com/python/cpython/commit/f4a0b80250576a71e342d09a8b1143f29cd5adc1
commit: f4a0b80250576a71e342d09a8b1143f29cd5adc1
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-10-17T12:25:18-07:00
summary:

gh-95914: Add What's New item describing PEP 670 changes (GH-98315)

(cherry picked from commit aafc53c0a6d1450dcfbc3f994318025ffb49ce73)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach at Gerlach.CAM>

files:
M Doc/whatsnew/3.11.rst

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 24ee491d28e2..b765b1a11b18 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -1899,6 +1899,17 @@ New Features
 Porting to Python 3.11
 ----------------------
 
+* Some macros have been converted to static inline functions to avoid
+  `macro pitfalls <https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html>`_.
+  The change should be mostly transparent to users,
+  as the replacement functions will cast their arguments to the expected types
+  to avoid compiler warnings due to static type checks.
+  However, when the limited C API is set to >=3.11,
+  these casts are not done,
+  and callers will need to cast arguments to their expected types.
+  See :pep:`670` for more details.
+  (Contributed by Victor Stinner and Erlend E. Aasland in :gh:`89653`.)
+
 * :c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback``
   arguments, the interpreter now derives those values from the exception
   instance (the ``value`` argument). The function still steals references



More information about the Python-checkins mailing list