tuples vs lists
shoot at the.moon
Sat Jan 8 15:36:09 CET 2005
> I get what the difference is between a tuple and a list, but why would I
> ever care about the tuple's immuutability?
Mainly for security and speed. Many library functions return info by returning
a reference to an internally held tuple, and could be damaged / compromised
/ corrupted if that internal data was modified by malicious code. If tuples
were mutable (lists) then it would be necessary to return a copy instead.
> Also, do you say 'too-ple' or 'chu-ple' - if you get my drift. (tomato or
> tomato kind of thing)
More information about the Python-list