Clarification on Immutability please

Jon Ribbens jon+usenet at unequivocal.eu
Tue Jan 21 15:54:59 EST 2020


On 2020-01-21, Chris Angelico <rosuav at gmail.com> wrote:
> On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker <stephen_tucker at sil.org> wrote:
>> I am left concluding that mytup is not actually a tuple (even though type
>> (mytup) tells me that it is).
>
> If type(mytup) is tuple, then mytup really truly is a tuple. There is
> no other conclusion.
>
>> My only explanation is that mytup is, actually, a pointer to a tuple; the
>> pointer can't change, but the contents of that pointer (or the data to
>> which the pointer points) can change.
>
> Incorrect. Python simply doesn't have that concept.

It's a bit weird that you took the bit where he realised exactly what
is actually happening and replied "incorrect".


More information about the Python-list mailing list