list vs tuple

Simon Brunning SBrunning at trisystems.co.uk
Wed Mar 28 09:20:03 EST 2001


> From:	deadmeat [SMTP:root@[127.0.0.1]]
> Whats the practical difference between a list[] and a tuple() ?
> 
> A tuple seems to be a very basic list, so unless it's faster, what's the
> point of it?
 
Off the top of my head - A tuple is immutable, and therefore hashable, and
therefore can be used as a key to a dictionary. I'm sure that there are
other things...

Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning at trisystems.co.uk





-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.




More information about the Python-list mailing list