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

Nick Coghlan ncoghlan at gmail.com
Mon Aug 15 05:16:44 CEST 2011


On Mon, Aug 15, 2011 at 12:34 PM, Brett Cannon <brett at python.org> wrote:
> On Thu, Aug 11, 2011 at 00:02, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> It would sound more useful to have a generic Py_RETURN() macro rather than
>> some specific forms for each and every common object.
>
> Since the macro is rather generic, sure, but the name should probably be
> better since it doesn't necessarily convene the fact that a INCREF has
> occurred. So maybe Py_INCREF_RETURN()?

Aside from None and NotImplemented, do we really do the straight
incref-and-return all that often?

While I was initially attracted to the idea of a generic macro, the
more I thought about it, the more it seemed like a magnet for
reference leak bugs.

Cheers,
Nick.

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


More information about the Python-Dev mailing list