syntax glitch with +=

David Eppstein eppstein at ics.uci.edu
Thu Feb 20 21:05:48 EST 2003


In article <mailman.1045784817.1817.python-list at python.org>,
 "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> wrote:

> No. += *uses* extend, but they are not identical. Specifically, every 
> augmented *assignment* operator includes an assignment as part of the 
> operation.
> 
> In the case of a list, the assignment is redundant, but still occurs.

Ok, thanks for the explanation.  The error with += makes more sense in 
that case, since a (redundant) assignment is happening.  I guess this 
means that, after the assignment, the variable name will be in local 
scope?

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/




More information about the Python-list mailing list