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 vstinner
Recipients python-dev, rhettinger, serhiy.storchaka, vstinner
Date 2016-02-11.11:28:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455190113.08.0.304080747628.issue26200@psf.upfronthosting.co.za>
In-reply-to
Content
Raymond Hettinger: "Most of the SETREFs in the next() functions in the itertools module should also be restored to there former state.  They look to have been correct before the change, so there was no improvement, only degradation.  Much of that code had been finely tuned and battle tested over many years -- the addition of SETREFs was gratuitous."

I guess that your concern is performance. Did you notice a performance difference on a micro-benchmark? I don't think that it's possible to see any difference with the addition of a single if in C.

I disagree that the change is gratuitous: it was discussed at length and approved on python-dev and the issue #20440. The idea was not new, it was already proposed in issue #3081 (opened in 2008). The issue #20440 (Py_SETREF) is a generic fix of the bug #16447. PyPy dev found crazy bugs in CPython :-)

IMHO correctness matters more than performance here.

Oh, and by the way, I like a macro which avoids 3 lines of C code ;-) It makes the code shorter and more readable.
History
Date User Action Args
2016-02-11 11:28:33vstinnersetrecipients: + vstinner, rhettinger, python-dev, serhiy.storchaka
2016-02-11 11:28:33vstinnersetmessageid: <1455190113.08.0.304080747628.issue26200@psf.upfronthosting.co.za>
2016-02-11 11:28:33vstinnerlinkissue26200 messages
2016-02-11 11:28:32vstinnercreate