On Dec 12, 2:34 pm, Hrvoje Niksic <hnik...@xemacs.org> wrote: > >>> import numpy > >>> t = (numpy.zeros(10),) > >>> t > > (array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]),)>>> t[0] += 1 > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: 'tuple' object does not support item assignment > > Of course, the side effect occurs before the exception, so: > > >>> t[0]
> array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]) Actually I would consider this to be a bug. The tuple is immutable, but no mutation of the tuple is ever attempted. Sturla Molden -- http://mail.python.org/mailman/listinfo/python-list