[Python-Dev] cpython: Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.

Ethan Furman ethan at stoneleaf.us
Tue Aug 16 01:13:50 CEST 2011


Barry Warsaw wrote:
> On Aug 16, 2011, at 08:32 AM, Nick Coghlan wrote:
>> Based on this thread, there are actually two options I'd be fine with:
>> 1. Just revert it and leave Py_RETURN_NONE as a special snowflake
>> 2. Properly generalise the incref-and-return idiom via a Py_RETURN macro
>>
>> Incrementally increasing complexity by adding a second instance of the
>> dedicated macro approach is precisely what we *shouldn't* be doing.
> 
> My problem with Py_RETURN(x) is that it's not clear that it also does an
> incref, and without that, I think it's *more* confusing to use rather than
> just writing it out explicitly, Py_RETURN_NONE's historic existence
> notwithstanding.
> 
> So I'd opt for #1, unless we can agree on a better color for the bikeshed.

My apologies if this is just noise, but are there RETURN macros that 
don't do an INCREF?

~Ethan~


More information about the Python-Dev mailing list