3 ms·
The title seems like false advertisement. It seems that strings in Python are indeed immutable. How it implements immutability is up to it (the implementation
by ymbeld 6y ago
The title seems like false advertisement. It seems that strings in Python are indeed immutable. How it implements immutability is up to it (the implementation), and making a brand new allocation for each operation is not the only way of adhering to the contract.
Get back to me if you can make several references to the same string and make them step on each others’ toes by only assigning a new value to one of them.