2 ms·
Good points. I guess it really depends what one considers immutable and mutable... Is an immutable list/tuple that contains mutable structures, a mutable or imm
by tomp 15y ago
Good points. I guess it really depends what one considers immutable and mutable... Is an immutable list/tuple that contains mutable structures, a mutable or immutable object?
The second issue, happens everytime you try to put a mutable object into a hashtable. I get bit by this issue quite often in python. In my opinion, there should be a default toMutable method that would make mutable objects immutable, and the map would then store the immutable version. That way, you could store e.g. Python lists in dicts, and have them compared by equality.