Le lundi 15 août 2011 à 13:16 +1000, Nick Coghlan a écrit : > On Mon, Aug 15, 2011 at 12:34 PM, Brett Cannon <br...@python.org> wrote: > > On Thu, Aug 11, 2011 at 00:02, Antoine Pitrou <solip...@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?
AFAICT, often with True and False: x = (some condition) ? Py_True : Py_False; Py_INCREF(x); return x; Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com