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

Nick Coghlan ncoghlan at gmail.com
Wed Dec 23 10:08:05 EST 2015


On 24 December 2015 at 00:50, Serhiy Storchaka <storchaka at gmail.com> wrote:
> On 22.12.15 18:36, Meador Inge wrote:
>>
>> On Tue, Dec 22, 2015 at 3:58 AM, Serhiy Storchaka <storchaka at gmail.com
>> <mailto:storchaka at gmail.com>> 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 bikeshedding.
>>
>>
>> FWIW, I like this name the best.  It is increasingly popular for
>> languages to talk about moving ownership (e.g. move semantics in C++,
>> Rust, etc...).
>
>
> Oh, I'm confused. Should I make a new poll? With new voters Py_MOVEREF can
> get more votes than Py_SETREF.

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 Py_MOVEREF, while other languages are starting to pay
more attention to "MOVE" semantics, we haven't really done so in
Python yet (moving references in Rust isn't the same thing we're
talking about here - this is just normal runtime reference counting).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list