Augmented Assignement (was: Re: PEP scepticism)

Courageous jkraska1 at san.rr.com
Mon Jul 2 02:15:10 EDT 2001


>> def f(x):
>> x = x + (1,2,3)
>> print x

>A vast improvement: clear, unambiguous, and correct.  I can safely pass a
>list as an argument and not have it modified behind my back.

Eek. I finally got what everyone is talking about.

x += (1,2,3)

... is not the same as...

x=x+(1,2,3)

That's just plain wrong.


C//




More information about the Python-list mailing list