[Python-Dev] odd "tuple does not support assignment" confusion...

Terry Reedy tjreedy at udel.edu
Sat Mar 3 00:57:35 CET 2012


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 discussed several times on python-list.
Searching group gmane.comp.python.general for 'augmented assignment 
tuple' at search.gmane.com returns about 50 matches.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list