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

Terry Reedy tjreedy at udel.edu
Thu May 26 19:59:51 CEST 2011


On 5/26/2011 10:34 AM, Ronald Oussoren wrote:
>
> On 26 May, 2011, at 16:10, Eric Smith wrote:
>>
>>
>>> and make silent the Clang Static Analyzer :-)
>>
>> I care less about that than maintainability and future-proofing.


> Have to looked at the patch? The patch and resulting code look sane to me, and if anything at most of the updated segments look cleaner after the patch.

Lets assume that the function currently does what it is supposed to do, 
as verified by tests. Then adding an unneeded increment in case the 
function is redefined in the future so that it needs more code strikes 
me as YAGNI. Certainly, reading it today with an unused increment 
suggests to me that something is missing that would use the incremented 
value. This strike me as different from adding a comma at the end of a 
Python sequence display.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list