]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95914: Add What's New item describing PEP 670 changes (GH-98315)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 17 Oct 2022 19:25:18 +0000 (12:25 -0700)
committerPablo Galindo <pablogsal@gmail.com>
Sat, 22 Oct 2022 19:18:03 +0000 (20:18 +0100)
(cherry picked from commit aafc53c0a6d1450dcfbc3f994318025ffb49ce73)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Doc/whatsnew/3.11.rst

index 2747eaeb4ecc5c800e0062fdc1a869bb6fc22c52..8e99e94347d97811fea8123f4603b69ed9d620ec 100644 (file)
@@ -1897,6 +1897,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