Coding style and Python versions (was Re: Another itertool function?)
Gerhard Häring
gh at ghaering.de
Mon Apr 28 10:06:07 EDT 2003
Aahz <aahz at pythoncraft.com> wrote:
> In article <b8hc64$6n2$1 at slb9.atl.mindspring.net>,
> Andrew Dalke <adalke at mindspring.com> wrote:
>>
>> i = i + 1
>
> I'm a little curious why you didn't write this as
>
> i += 1
>
> Any reason (i.e. still need to support 1.5.2) or just habit? If the
> latter, why haven't you changed your habit?
I use += and friends myself. But one could argue that the ability of the
inplace operators to return new objects is everything but clean.
-- Gerhard
More information about the Python-list
mailing list