Conversation
Add Py_SetRef() and Py_XSetRef() functions to set a strong reference to a new object without creating a temporary dangling pointer. Rewrite the Py_SETREF() and Py_XSETREF() macros using respectively Py_SetRef() and Py_XSetRef() functions. Rewrite the Py_CLEAR() macro using the Py_XSetRef() public.
|
I am not sure about this change really helps Rust, PyPy, HPy, etc. |
There was no discussion about that. I prefer to convert this PR to a draft until I have more time to explain the overall rationale for https://bugs.python.org/issue42294 Also, Serhiy wrote that Py_SETREF() had some flaws, I didn't know that. I will have to dig into old discussions. |
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
|
This PR is stale because it has been open for 30 days with no activity. |

Add Py_SetRef() and Py_XSetRef() functions to set a strong reference
to a new object without creating a temporary dangling pointer.
Rewrite the Py_SETREF() and Py_XSETREF() macros using respectively
Py_SetRef() and Py_XSetRef() functions.
Rewrite the Py_CLEAR() macro using the Py_XSetRef() public.
https://bugs.python.org/issue42294