pitfall for your amusement

Martin v. Loewis martin at v.loewis.de
Tue Nov 12 15:39:52 EST 2002


Gustavo Niemeyer <niemeyer at conectiva.com> writes:

> > >>> x = (1, 2, 3)
> [...]
> > >>> x += (4, 5, 6)
> 
> Hey, shouldn't this raise an exception?

Because the tuple is immutable? Then would you expect

x += 1

to raise an exception also?

Regards,
Martin



More information about the Python-list mailing list