[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8b6c4a921af6d5d0a9640211ac93d7886a55a8f3 by Victor Stinner in branch 'master': bpo-42262: Py_NewRef() casts its argument to PyObject* (GH-23626) https://github.com/python/cpython/commit/8b6c4a921af6d5d0a9640211ac93d7886a55a8f3 --

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-12-03 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22494 pull_request: https://github.com/python/cpython/pull/23626 ___ Python tracker ___

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-05 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset 53a03aafd5812018a3821a2e83063fd3d6cd2576 by Victor Stinner in branch 'master': bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152) https://github.com/python/cpython/commit/53a03aafd5812018a3821a2e83063fd3d6cd2576 --

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread Simon Cross
Change by Simon Cross : -- nosy: +hodgestar ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread STINNER Victor
STINNER Victor added the comment: > The problem in these patterns is that the object has to be written twice. I'm talking about the variable name which has to be repeated (written twice) in the source code. -- ___ Python tracker

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +22064 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23152 ___ Python tracker ___

[issue42262] [C API] Add Py_NewRef() function to get a new strong reference to an object

2020-11-04 Thread STINNER Victor
New submission from STINNER Victor : In C, the following pattern (A) is very common: Py_INCREF(sysdict); interp->sysdict = sysdict; * (1) Increment the reference counter * (2) Store a reference to the object somewhere Similar pattern (B) using return: Py_INCREF(temp); return