Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Nov 9, 2022

The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated.

Add test_py_clear() and test_py_setref() unit tests to _testcapi.

(cherry picked from commit c03e05c)

The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated. Add test_py_clear() and test_py_setref() unit tests to _testcapi. (cherry picked from commit c03e05c)
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@vstinnervstinner deleted the py_clear311 branch November 9, 2022 15:29
@bedevere-bot
Copy link

GH-99292 is a backport of this pull request to the 3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10 only security fixes label Nov 9, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 9, 2022
…ythonGH-99288) The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated. Add test_py_clear() and test_py_setref() unit tests to _testcapi. (cherry picked from commit 1082890) Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit c03e05c)
vstinner added a commit that referenced this pull request Nov 18, 2022
vstinner added a commit that referenced this pull request Nov 21, 2022
…9100)" (#99573) Revert "gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#99288)" This reverts commit 1082890.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@miss-islington@bedevere-bot