Relax Syntax for Augmented Arithmetic?

Mark Wooding mdw at distorted.org.uk
Fri Jan 23 07:36:11 EST 2009


aahz at pythoncraft.com (Aahz) writes:

> Actually, that is not correct. 

You're right, evidently.

[snip]

>>>> a
> (1, ['foo', 'bar'], 'xyzzy')
>>>> a[1] += ['spam']
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: object doesn't support item assignment
>>>> a
> (1, ['foo', 'bar', 'spam'], 'xyzzy')

Ugh!

-- [mdw]



More information about the Python-list mailing list