[Python-Dev] [Python-checkins] cpython: Avoid useless "++" at the end of functions
benjamin at python.org
Thu May 26 16:50:03 CEST 2011
2011/5/26 Victor Stinner <victor.stinner at haypocalc.com>:
> Le jeudi 26 mai 2011 à 08:13 -0400, Eric Smith a écrit :
>> If you're ever going to add code at the end of these functions, it's
>> unlikely you'll remember that you need to add these increments back in.
> You don't have to remember. Test the result of the function, it will not
> give the expected output. I don't think that you need fuzzing or a
> complex tool to detect that the new code doesn't behave correctly.
>> It's a bug waiting to happen
> What? It's not a bug. Ading new non-tested code is a bug :-)
>> I don't see any harm leaving them in.
>> Maybe we should add a comment about why they're done.
> It makes Python faster (!) and make silent the Clang Static Analyzer :-)
Surely, GCC can optimize that out.
More information about the Python-Dev