Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-95914: Add What's New item describing PEP 670 changes #98315

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,17 @@ New Features
Porting to Python 3.11
----------------------

* Many macros have been converted to functions in the Python C API,
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved
making them usable from other programming languages and avoiding
`macro pitfalls <https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html>`_
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved
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,
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved
and callers will need to cast arguments to their expected values.
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved
See :pep:`670` for more details.
(Contributed by Victor Stinner in :gh:`89653`.)
CAM-Gerlach marked this conversation as resolved.
Show resolved Hide resolved

* :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
Expand Down