Andy Chugunov added the comment:
Thank you guys for all the efforts you put in solving and answering this.
Just so that we're clear.
It is perfectly legitimate to extend lists withing tuples. It just doesn't seem
possible to make augmented assignment and simple assignment h
New submission from Andy Chugunov:
At the same time append() succeeds silently, while simple '+' fails.
Here's an example:
>>> a = ([1],)
>>> a[0].append(2)
>>> a
([1, 2],)
>>> a[0] += [3]
Traceback (most recent call last):
File ""
Andy Chugunov added the comment:
Thank you for the clarification! The exception is appropriate as tuples have to
stay immutable. Got it.
Could you please also explain a bit about the append() call? Should it in
theory raise an exception as well or is such clean behavior intended