Victor Stinner
Victor Stinner
> Should sys.getrefcount try to "fix" the value (...) https://peps.python.org/pep-0683/ would make it possible. Right now, I don't think that it's possible. Right now, a refcount of 1000000210 can be...
> `_Py_Identifier` has been useful but at this point there is a faster and simpler approach we could take as a replacement: statically initialize the objects as fields on `_PyRuntimeState`...
"Duplication of side effects" is one catch of macros that PEP 670 tries to avoid: https://peps.python.org/pep-0670/#rationale Sadly, Py_CLEAR() cannot be converted to a function (as part of PEP 670) since...
Maybe a ``Py_ClearRef(PyObject **)`` function shoud also be added? Somehow related discussions: * https://github.com/python/cpython/issues/86428 * https://github.com/python/cpython/issues/86460
> The macro Py_CLEAR(op) references the argument op two times. If the macro is called with an expression it will be evaluated two times, for example Py_CLEAR(p++). This issue looks...
I created PR #99100 to fix this issue. I'm not convinced that we should fix it, but a full PR might help to make a decision. In the past, I...
Ah wait, I read again https://github.com/python/cpython/issues/98724#issuecomment-1292591490 and now I got the issue :-) I updated the unit test in my PR #99100.
> We can make it working even for arguments with a side effect, but should it be considered a bug fix or a new feature? My PR fix the macro...
I completed my PR to fix also Py_SETREF() and Py_XSETREF() macros.
@ambv: Would you mind to merge this security fix? It's already in other branches, including 3.7 ;-)