[Python-Dev] [Python-checkins] cpython: Avoid useless "++" at the end of functions

Victor Stinner victor.stinner at haypocalc.com
Thu May 26 14:32:51 CEST 2011


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 :-)

Victor




More information about the Python-Dev mailing list