[issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown

STINNER Victor report at bugs.python.org
Wed Apr 12 06:10:17 EDT 2017


STINNER Victor added the comment:

I dislike _Py_SET_FINALIZED and _Py_SET_ONCE name.

I prefer to mention an "initialization" because it's a common pattern in programming and it is known that it only requires to be done once.

_PY_ONCEVAR_INIT() macro is unusual: it only evaluate the second parameter parameter, a C expression, if the variable is not initialized yet.

Py_SETREF() is different because it always evaluates its second argument, and in most cases, the second argument is an existing variable and not an expression.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29881>
_______________________________________


More information about the Python-bugs-list mailing list