No clue why Tuples in Python are immutable. It seems to me that this is a flaw in the language. I’m no expert on underlying programming language architecture. But it seems to me that if I want a
myTuple = {('NAMED1':variable1,
'NAMED2':variable2,
'NAMED3':variable3)}
Where there is some interrelation between variable1, variable2 and variable3. If I subsequently what to set NAMED3 to new variable4. There is no way to do this.
Wouldn’t it be nice if one could do?
myTuple['NAMED3'] = variable4
So now I’d have:
myTuple = {('NAMED1':variable1,
'NAMED2':variable2,
'NAMED3':variable4)}
This fails because of Tuples immutability.
One way to overcome this is create a new Tuple and then delete the existing Tuple. This becomes very interesting when I have list of Tuples were you make a new tuple add it to the list and delete the existing Tuple.
Seems like a lot of hassle for a language which is suppose to be very programmer friendly.