New submission from Mike Smith <scgtrp+python-b...@gmail.com>:

Using += to append to a list inside a tuple raises a TypeError but succeeds in 
appending the value anyway:

>>> t = (1, [2, 3, 4])
>>> t[1].append(5)
>>> t[1] += [6]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> t
(1, [2, 3, 4, 5, 6])

I have reproduced this on all the Python interpreters available to me (CPython 
2.6, 2.7, and 3.1).

----------
components: Interpreter Core
messages: 131055
nosy: scgtrp
priority: normal
severity: normal
status: open
title: += on list inside a tuple raises TypeError but succeds anyway
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to