One last shot at the Augmented Assignment PEP

Rainer Deyke root at rainerdeyke.com
Wed Sep 13 20:44:30 EDT 2000


"Huaiyu Zhu" <hzhu at users.sourceforge.net> wrote in message
news:slrn8s04pv.9on.hzhu at rocket.knowledgetrack.com...
> How about using = for assignment and ! for augmentation?
>
> a = b = [];   a += [1]   # a==[1] and b==[]
> a = b = [];   a +! [1]   # a==[1]==b
>
> a = b = ();   a += (1,)  # a==(1,) and b==()
> a = b = ();   a +! (1,)  # Error, () is immutable.

This makes sense to me.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list