Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Nick Coghlan
On 24 December 2015 at 00:50, Serhiy Storchaka wrote: > On 22.12.15 18:36, Meador Inge wrote: >> >> On Tue, Dec 22, 2015 at 3:58 AM, Serhiy Storchaka > > wrote: >> >> On 21.12.15 23:57, Steve Dower wrote: >> >> Was

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Serhiy Storchaka
On 23.12.15 16:52, Chris Angelico wrote: On Thu, Dec 24, 2015 at 1:50 AM, Serhiy Storchaka wrote: Oh, I'm confused. Should I make a new poll? With new voters Py_MOVEREF can get more votes than Py_SETREF. I suggest cutting off the bikeshedding. Both of these options have

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Chris Angelico
On Thu, Dec 24, 2015 at 1:50 AM, Serhiy Storchaka wrote: > Oh, I'm confused. Should I make a new poll? With new voters Py_MOVEREF can > get more votes than Py_SETREF. I suggest cutting off the bikeshedding. Both of these options have reasonable support. Pick either and run

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Serhiy Storchaka
On 22.12.15 18:36, Meador Inge wrote: On Tue, Dec 22, 2015 at 3:58 AM, Serhiy Storchaka > wrote: On 21.12.15 23:57, Steve Dower wrote: Was Py_MOVEREF (or MOVE_REF) ever suggested? This would be nice name. The macro moves the

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Meador Inge
On Wed, Dec 23, 2015 at 9:08 AM, Nick Coghlan wrote: > Within the Python context, the analogy from setattr and setitem at the > Python level to Py_SETREF at the C level is pretty solid, so it likely > makes sense to run with that as "good enough". > > In regards to

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-23 Thread Stephen J. Turnbull
Serhiy Storchaka writes: > This would be a voluntarism. You did due diligence, took the poll, and got additional information as well. It is *very* clear to me at least that you are paying full attention to the poll. Yes, the bikeshedding should end but I think you should do as you think best

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-22 Thread Serhiy Storchaka
On 21.12.15 17:37, Nick Coghlan wrote: Avoiding those misleading associations is a good argument in favour of Py_REPLACE over Py_SETREF - they didn't occur to me before casting my votes, and I can definitely see them causing confusion in the future. So perhaps the combination that makes the

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-22 Thread Serhiy Storchaka
On 21.12.15 23:57, Steve Dower wrote: Was Py_MOVEREF (or MOVE_REF) ever suggested? This would be nice name. The macro moves the ownership. But I think it's too late. Otherwise we'll never finish the bikeshedding. ___ Python-Dev mailing list

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-22 Thread Meador Inge
On Tue, Dec 22, 2015 at 3:58 AM, Serhiy Storchaka wrote: On 21.12.15 23:57, Steve Dower wrote: > >> Was Py_MOVEREF (or MOVE_REF) ever suggested? >> > > This would be nice name. The macro moves the ownership. But I think it's > too late. Otherwise we'll never finish the

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-22 Thread Random832
Nick Coghlan writes: > Avoiding those misleading associations is a good argument in favour of > Py_REPLACE over Py_SETREF - they didn't occur to me before casting my > votes, and I can definitely see them causing confusion in the future. > > So perhaps the combination that

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-21 Thread Mark Lawrence
On 21/12/2015 21:57, Steve Dower wrote: Was Py_MOVEREF (or MOVE_REF) ever suggested? Those are valid objections, and now they're raised I remember them from last time. But I don't think they're a huge concern - setting a ref count directly doesn't seem useful anyway, and the compiler/IDE will

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-21 Thread Steve Dower
dev@python.org> Subject: Re: [Python-Dev] New poll about a macro for safe reference replacing On 21 December 2015 at 23:46, Serhiy Storchaka <storch...@gmail.com> wrote: > On 16.12.15 16:12, Serhiy Storchaka wrote: >> >> Please put your vote (a floating number from -1 to

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-21 Thread Serhiy Storchaka
On 16.12.15 16:12, Serhiy Storchaka wrote: Please put your vote (a floating number from -1 to 1 including) for every of proposed name. You also can propose new name. Thank you all for your votes. Results of the poll: Py_SETREF: +5 = +5 (Victor, Steve, Yury, Brett, Nick) +0 (Ryan, Martin)

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-21 Thread Nick Coghlan
On 21 December 2015 at 23:46, Serhiy Storchaka wrote: > On 16.12.15 16:12, Serhiy Storchaka wrote: >> >> Please put your vote (a floating number from -1 to 1 including) for >> every of proposed name. You also can propose new name. > > > Thank you all for your votes. > >

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Victor Stinner
2015-12-16 15:12 GMT+01:00 Serhiy Storchaka : > Here are names gained the largest numbers of votes plus names proposed > during polling. > > 1. Py_SETREF +1: obvious name > 2. Py_DECREF_REPLACE -1: too long > 3. Py_REPLACE 0: less explicit than but: not mention of

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Victor Stinner
2015-12-16 16:12 GMT+01:00 Serhiy Storchaka : > Originally I proposed pairs of functions with and withot X in the name (as > Py_DECREF/Py_XDECREF). In this poll this detail is omitted for clearness. > Later we can create a new poll if needed. I would prefer a single macro to

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Steve Dower
dev@python.org> Subject: Re: [Python-Dev] New poll about a macro for safe reference replacing 2015-12-16 15:12 GMT+01:00 Serhiy Storchaka <storch...@gmail.com>: > Here are names gained the largest numbers of votes plus names proposed > during polling. > > 1. Py_SETREF +1: obvi

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Yury Selivanov
Here are names gained the largest numbers of votes plus names proposed during polling. 1. Py_SETREF 2. Py_DECREF_REPLACE 3. Py_REPLACE 4. Py_SET_POINTER 5. Py_SET_ATTR 6. Py_REPLACE_REF I like Py_SETREF, so +1 for it. 0 for other names. Yury ___

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Brett Cannon
On Wed, 16 Dec 2015 at 14:41 Yury Selivanov wrote: > > > Here are names gained the largest numbers of votes plus names proposed > > during polling. > > > > 1. Py_SETREF > > 2. Py_DECREF_REPLACE > > 3. Py_REPLACE > > 4. Py_SET_POINTER > > 5. Py_SET_ATTR > > 6.

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Nick Coghlan
On 17 December 2015 at 00:12, Serhiy Storchaka wrote: > The problem is only in the macro name. There are objections against any > proposed name, and no one name gained convincing majority. > > Here are names gained the largest numbers of votes plus names proposed > during

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Martin Panter
On 16/12/2015, Serhiy Storchaka wrote: > Here are names gained the largest numbers of votes plus names proposed > during polling. > > 1. Py_SETREF +0. I can live with it, but SET sounds like a complement to CLEAR, or that it ignores the old value. > 2. Py_DECREF_REPLACE +0.5

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Random832
Serhiy Storchaka writes: > I'm bringing this up again, since the results of the previous poll did > not give an unambiguous result. Related links: [1], [2], [3], [4]. > > Let me remind you that we are talking about adding the following > macro. It is needed for safe

[Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Serhiy Storchaka
I'm bringing this up again, since the results of the previous poll did not give an unambiguous result. Related links: [1], [2], [3], [4]. Let me remind you that we are talking about adding the following macro. It is needed for safe replacement links. For now there is at least one open crash

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Serhiy Storchaka
On 16.12.15 16:53, Random832 wrote: At the risk of bikeshedding, this needs do { ... } while(0), or it almost certainly will eventually be called incorrectly in an if/else statement. Yes, it's ugly, but that's part of the cost of using macros. Yes, of course, and the patch for issue20440 uses

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Ryan Gonzalez
On December 16, 2015 8:12:47 AM CST, Serhiy Storchaka wrote: >I'm bringing this up again, since the results of the previous poll did >not give an unambiguous result. Related links: [1], [2], [3], [4]. > >Let me remind you that we are talking about adding the following

Re: [Python-Dev] New poll about a macro for safe reference replacing

2015-12-16 Thread Random832
Serhiy Storchaka writes: >> I'm not entirely sure of the benefit of a macro over an inline >> function. > > Because the first argument is passed by reference (as in Py_INCREF > etc). Then a macro implemented using an inline function, e.g., #define Py_REPLACE(p, x)