<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Terry Reedy wrote:
>> Program performance might be noticeable if 'x' is something like a.b.c.d
>> that takes some lookup time.  But again, I would use the += form for
>> readability without testing run time.
>
> Would x=x + 1 be more readable, regardless of the background(whether
> being introduced to the += form in some other language like C before) ?

To *me*,

able.baker.charles.delta += 1

is more easily read than

able.baker.charles.delta = able.baker.charles.delta +1

because it is clear that there is one and only one attribute involved, 
being updated in place, whereas the latter might have been

able.baker.charles.delta = able.baker.charley.delta +1

Therefore, as I said originally *I* would use the += form.

Terry Jan Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to