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

double side effects in args of Py_CLEAR/Py_SETREF #3

Open
iritkatriel opened this issue May 9, 2023 · 2 comments
Open

double side effects in args of Py_CLEAR/Py_SETREF #3

iritkatriel opened this issue May 9, 2023 · 2 comments
Labels
fixable stakeholder: extension authors theme: implementation flaws problems with the implementation of specific APIs

Comments

@iritkatriel
Copy link
Member

See python/cpython#98724.

@serhiy-storchaka
Copy link

Py_CLEAR and Py_SETREF are macros (they cannot be functions). I think that we should simply document that the first argument should not have a side effect. It is the same as for Py_MAX, nobody expect that they work with arguments with a side effect.

@vstinner
Copy link
Contributor

double side effects in args of Py_CLEAR/Py_SETREF

Maybe the scope of this issue can be broader, like: some functions are implemented as macros with macro pitfalls, whereas some others are implemented as function calls or macros without macro pitfalls. Or in short: macro with macro pitfalls are considered harmful :-)

@iritkatriel iritkatriel added the v label Jul 21, 2023
@iritkatriel iritkatriel removed the v label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixable stakeholder: extension authors theme: implementation flaws problems with the implementation of specific APIs
Projects
None yet
Development

No branches or pull requests

3 participants