l[0] += [1]

is the same as

l[0] = l[0] + [1]

Does that make the reason for the error clearer? The problem is the
attempt to assign a value to l[0].

It is not the same as

e = l[0]
e += [1]

which is the equivalent to

e = l[0]
e = e + [1]

This never assigns a value to l[0].

Schiavo
Simon
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to