A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132856.html below:

[Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc

[Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etc [Python-Dev] Poll: Py_REPLACE/Py_ASSIGN/etcBarry Warsaw barry at python.org
Fri Feb 28 16:19:48 CET 2014
On Feb 28, 2014, at 10:27 PM, Nick Coghlan wrote:

>With the new macro in place, the existing Py_CLEAR(x) macro would be
>equivalent to Py_SETREF(x, NULL).
>
>Originally I was also concerned about the "how will people know there's no
>implicit incref?", but I've since become satisfied with the fact that the
>precedent set by the reference stealing SET_ITEM macros is strong enough to
>justify the shorter name.

I haven't had time to follow this discussion at all, but for a macro to be
called Py_SETREF and *not* increment the reference counter seems at best
confusing.  Despite my hesitation to paint a bike shed I haven't had time to
inspect, something more akin to Py_SET_POINTER seems more appropriate
(i.e. don't put "REF" in the name if it isn't playing refcounting games).

-Barry
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4