Augmented Assignement (was: Re: PEP scepticism)
aahz at panix.com
Mon Jul 2 11:35:35 EDT 2001
In article <naO%6.416271$oc7.58537852 at news2.rdc2.tx.home.com>,
Rainer Deyke <root at rainerdeyke.com> wrote:
>"Courageous" <jkraska1 at san.rr.com> wrote in message
>news:q0avjto87p59hn7gv28r5cf1c84j2fb8c7 at 4ax.com...
>> 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. Having to
>write "x" twice on the second line is not good, but if it buys me
>correctness, I'll happily pay that price.
In what version of Python can you pass a list to f() here?
--- Aahz <*> (Copyright 2001 by aahz at pobox.com)
Hugs and backrubs -- I break Rule 6 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista
"I'm not tense, i'm just terribly, terribly alert" --unknown
More information about the Python-list