This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients _doublep, belopolsky, benjamin.peterson, exarkun, jcea, mark.dickinson, pitrou, rhettinger
Date 2010-04-08.21:03:03
SpamBayes Score 2.8197954e-05
Marked as misclassified No
Message-id <1270760586.94.0.654979580484.issue3081@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with Raymond about the Py_INCREF.  I could see more uses for this macro without the Py_INCREF, especially for things like in-place arithmetic operations.  The following pattern appears a lot in code like Objects/longobject.c:

Old code:

/* add one to x */
temp = PyNumber_Add(x, one);
Py_DECREF(x);
x = temp;
if (x == NULL)
    return NULL;


With a non-INCREF version of Py_SETREF:

/* add one to x */
Py_SETREF(x, PyNumber_Add(x, one));
if (x == NULL)
    return NULL;
History
Date User Action Args
2010-04-08 21:03:07mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, jcea, exarkun, belopolsky, pitrou, _doublep, benjamin.peterson
2010-04-08 21:03:06mark.dickinsonsetmessageid: <1270760586.94.0.654979580484.issue3081@psf.upfronthosting.co.za>
2010-04-08 21:03:04mark.dickinsonlinkissue3081 messages
2010-04-08 21:03:03mark.dickinsoncreate