[Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc
Kristján Valur Jónsson
kristjan at ccpgames.com
Thu Feb 27 14:10:32 CET 2014
I agree with NICK. having REF in it is a good idea.
So, I'm +1 on setref.
Having long explicit macros with exact semantics in the name is a bad one.
so I'm -1 on any Py_DECREF_AND_REPLACE or similar daschhunds.
Also, is there any real requirement for having separate non-X versions of these?
The Xs constitue a permutation explosion, particularly if you want then also versions that INCREF the source :)
K
From: Python-Dev [mailto:python-dev-bounces+kristjan=ccpgames.com at python.org] On Behalf Of Nick Coghlan
Sent: 27. febrúar 2014 00:12
To: Antoine Pitrou
Cc: python-dev at python.org
Subject: Re: [Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc
On 27 Feb 2014 04:28, "Antoine Pitrou" <solipsis at pitrou.net<mailto:solipsis at pitrou.net>> wrote:
>
> On Wed, 26 Feb 2014 11:40:01 +0200
> Serhiy Storchaka <storchaka at gmail.com<mailto:storchaka at gmail.com>> wrote:
>
> > There were several suggestions for naming new macros which replace old
> > value with new value and then (x)decref old value.
> >
> > #define Py_XXX(ptr, value) \
> > { \
> > PyObject *__tmp__ = ptr; \
> > ptr = new_value; \
> > Py_DECREF(__tmp__); \
> > }
>
>
> > 1. Py_(X)SETREF.
>
> My vote is on this one.
> I'm also -1 on any name which doesn't have "REF" in it; the name should
> clearly suggest that it's a refcounting operation.
Yeah, I think SETREF is my favourite as well (even though some of the later suggestions were mine).
Cheers,
Nick.
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org<mailto:Python-Dev at python.org>
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140227/039f5af0/attachment.html>
More information about the Python-Dev
mailing list