Re: [Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-04 Thread Guido van Rossum
Agreed, let's go with two macros. The time discussing this further could be spent more productively. On Mon, Apr 4, 2016 at 2:35 AM, Victor Stinner wrote: > If some dev don't want to use the single macro for good or bad reasons, it's > maybe better to have two macros to generalize their usage. Th

Re: [Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-04 Thread Victor Stinner
If some dev don't want to use the single macro for good or bad reasons, it's maybe better to have two macros to generalize their usage. The macro makes to C code shorter and easier to review. Victor ___ Python-Dev mailing list Python-Dev@python.org https

Re: [Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-04 Thread Nick Coghlan
On 3 April 2016 at 17:32, Serhiy Storchaka wrote: > Originally I proposed a pair of macros for safe reference replacing to > reflects the duality of Py_DECREF/Py_XDECREF. [1], [2] The one should use > Py_DECREF and the other should use Py_XDECREF. > > But then I got a number of voices for the sin

Re: [Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-03 Thread Armin Rigo
Hi, On 3 April 2016 at 15:29, MRAB wrote: >> Should we rename Py_SETREF to Py_XSETREF and introduce new Py_SETREF >> that uses Py_DECREF? > > Checking for NULL is convenient (and safer), but, on the other hand, it > _would_ be consistent with the others. My 2 cents would be to call the new macro

Re: [Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-03 Thread MRAB
On 2016-04-03 08:32, Serhiy Storchaka wrote: Originally I proposed a pair of macros for safe reference replacing to reflects the duality of Py_DECREF/Py_XDECREF. [1], [2] The one should use Py_DECREF and the other should use Py_XDECREF. But then I got a number of voices for the single name [3],

[Python-Dev] Py_SETREF vs. Py_XSETREF

2016-04-03 Thread Serhiy Storchaka
Originally I proposed a pair of macros for safe reference replacing to reflects the duality of Py_DECREF/Py_XDECREF. [1], [2] The one should use Py_DECREF and the other should use Py_XDECREF. But then I got a number of voices for the single name [3], and no one voice (except mine) for the pai