With Python 2.6.5 (on ubuntu) I get even more bizarre behavior: >>> foo=(1,[2,3,4]) >>> foo[1]+=6 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'int' object is not iterable >>> foo (1, [8, 9, 10])
On Fri, Apr 1, 2011 at 6:17 PM, Noufal Ibrahim <nou...@gmail.com> wrote: > > Came across this at PyCon. Comments? > > >>> foo = (1,[2,3,4]) > >>> foo[1] += [6] > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: 'tuple' object does not support item assignment > >>> foo > (1, [2, 3, 4, 6]) > >>> > > -- > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers