[issue33879] Item assignment in tuple mutates list despite throwing error

njayinthehouse report at bugs.python.org
Sat Jun 16 11:13:15 EDT 2018


New submission from njayinthehouse <nitinjohnraj at gmail.com>:

Seems like a bug.

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

----------
messages: 319748
nosy: njayinthehouse
priority: normal
severity: normal
status: open
title: Item assignment in tuple mutates list despite throwing error
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33879>
_______________________________________


More information about the Python-bugs-list mailing list