-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I encountered a TypeError exception in a script and reproduced it in the interactive shell:
>>> t = ([1, 2, 3], [4, 5, 6])
>>> t[0] += [7]
Traceback (most recent call last):
File "<python-input-10>", line 1, in <module>
t[0] += [7]
~^^^
TypeError: 'tuple' object does not support item assignment
>>> o = t[0]; o += [7]
>>> o
[1, 2, 3, 7, 7]
Not only it raises the unexpected TypeError exception as if operating on a tuple, but the item assignment takes place: number 7 appears twice in the list!
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error