Tuples and immutability

Chris Angelico rosuav at gmail.com
Sat Mar 1 07:29:44 CET 2014

On Sat, Mar 1, 2014 at 5:16 PM, Mark H. Harris <harrismh777 at gmail.com> wrote:
> This is what I mean...   the error message is telling the user that it cannot do what he has requested, and yet IT DID.  You have one of two scenarios:   1) the message is arbitrarily lying and it really can assign an immutable's item...  (and it did!)  or 2)  It really should NOT assign an immutables item (the message is truth) but the action was "allowed" anyway despite the protocol and accepted policy...  in which case the two scenarios add up to a giant logical inconsistency...  QED   a bug.

It did not assign anything. The error was raised because the tuple
rejects item assignment. It's that simple.

The object was mutated before the assignment was attempted.


More information about the Python-list mailing list