I knew this was a feature!!!
features such as these should be fixed! %)
On Sat, Mar 3, 2012 at 03:38, R. David Murray wrote:
> On Sat, 03 Mar 2012 03:06:33 +0400, "Alex A. Naanou"
> wrote:
>> Hi everyone,
>>
>> Just stumbled on a fun little thing:
>>
>> We create a simple structure...
>>
>
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 discu
On Sat, Mar 3, 2012 at 1:38 AM, R. David Murray 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
http://mail.python.org/mailman/listinfo/py
On Sat, 03 Mar 2012 03:06:33 +0400, "Alex A. Naanou"
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):
> ## File
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
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):
## File "F:\work\ImageGrid\cur\ImageGrid\src\test\python-bug.py",
line 17, in
## l[0] += [1]
## Ty