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
On Sat, 03 Mar 2012 03:06:33 +0400, Alex A. Naanou alex.na...@gmail.com
wrote:
Hi everyone,
Just stumbled on a fun little thing:
We create a simple structure...
l = ([],)
Now modify the list, and...
l[0] += [1]
...we fail:
## Traceback (most recent call last):
##
On Sat, Mar 3, 2012 at 1:38 AM, R. David Murray rdmur...@bitdance.com wrote:
What is even more fun is that the append actually worked (try printing
l).
Now that is just weird. :)
___
Python-Dev mailing list
Python-Dev@python.org
On 3/2/2012 6:06 PM, Alex A. Naanou wrote:
Just stumbled on a fun little thing:
The place for 'fun little things' is python-list, mirrored as
gmane.comp.python.general.
We create a simple structure...
l = ([],)
Now modify the list, and...
l[0] += [1]
...we fail:
This has been
I knew this was a feature!!!
features such as these should be fixed! %)
On Sat, Mar 3, 2012 at 03:38, R. David Murray rdmur...@bitdance.com wrote:
On Sat, 03 Mar 2012 03:06:33 +0400, Alex A. Naanou alex.na...@gmail.com
wrote:
Hi everyone,
Just stumbled on a fun little thing:
We