8000 gh-98724: Fix Py_CLEAR() macro side effects by vstinner · Pull Request #99100 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-98724: Fix Py_CLEAR() macro side effects #99100

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

Merged
merged 3 commits into from
Nov 9, 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
Prev Previous commit
Next Next commit
Py_SETREF() was added to Python 3.6 (and Python 3.5.2)
  • Loading branch information
vstinner committed Nov 9, 2022
commit 655234e0dbe6ec60f11cd2c3ef46f2e7b24099f5
4 changes: 4 additions & 0 deletions Doc/c-api/refcounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ of Python objects.
*dst* old value, so that any code triggered as a side-effect of `dst`
getting torn down no longer believes `dst` points to a valid object.

.. versionadded:: 3.6

.. versionchanged:: 3.12
The macro arguments are now only evaluated once. If an argument has side
effects, there are no longer duplicated.
Expand All @@ -174,6 +176,8 @@ of Python objects.
Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead
of :c:func:`Py_DECREF`.

.. versionadded:: 3.6

.. versionchanged:: 3.12
The macro arguments are now only evaluated once. If an argument has side
effects, there are no longer duplicated.
0