Nested scopes, and augmented assignment

Piet van Oostrum piet at cs.uu.nl
Mon Jul 10 11:05:02 EDT 2006


>>>>> Antoon Pardon <apardon at forel.vub.ac.be> (AP) wrote:

>AP> I'm sorry to see you missed it, but since I had answered this already in
>AP> this thread I saw at the moment no need to repeat it: There would be no
>AP> value for c, the line would raise an UnboundLocalError.

OK. That could have been chosen. But that would mean that instead of c.a =
b, where c is bound in a non-local scope, you have to write something like:

cc = c
cc.a = b

I don't find that useful.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list