[Python-ideas] Globalize lonely augmented assignment

Demur Rumed junkmute at hotmail.com
Sun Jun 13 14:53:44 CEST 2010


> > But if the programmer intended a to be global, the *only*
>
 > reason it's a bug is the current somewhat arbitrary
> > 
interpretation placed on the augmented assignment.
> 
> Hmm,
 I would call it consistent rather than arbitrary.
> 
> 
Georg

a=[1,2,3]

def f(x):a[x]=x

f(0)



Some like to think of []= as a form of augmented assignment

Currently, []= doesn't align with other augmenteds on this point

That doesn't seem very consistent. Add on that augmented
assignment is the only globalizing store statement which also
dereferences, and consistency doesn't seem to be a strong point
against this proposal
 		 	   		  
_________________________________________________________________
Regardez-moi dans les yeux : vidéobavardage GRATUIT
http://go.microsoft.com/?linkid=9734396
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100613/1334fde0/attachment.html>


More information about the Python-ideas mailing list