かなり奇妙なことに出くわしました。
>>> t = ([],)
>>> t[0].append('hello')
>>> t
(['hello'],)
>>> t[0] += ['world']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> t
(['hello', 'world'],)
なぜそれは上昇TypeError
し、それでもlist
内部を変えるのtuple
ですか?