On Wed, Feb 1, 2012 at 10:18 PM, John O'Hagan <resea...@johnohagan.com> wrote: > On Fri, 13 Jan 2012 10:40:47 -0800 > Ethan Furman <et...@stoneleaf.us> wrote: > >> Steven D'Aprano wrote: >> > Normally this is harmless, but there is one interesting little >> > glitch you can get: >> > >> >>>> t = ('a', [23]) >> >>>> t[1] += [42] >> > Traceback (most recent call last): >> > File "<stdin>", line 1, in <module> >> > TypeError: 'tuple' object does not support item assignment >> >>>> t >> > ('a', [23, 42]) > > IMHO, this is worthy of bug-hood: shouldn't we be able to conclude from the > TypeError that the assignment failed?
It did fail. The mutation did not. I can't think of any way out of this misleadingness, although if you can that would be pretty awesome. -- Devin -- http://mail.python.org/mailman/listinfo/python-list