Python Interview Questions

Roy Smith roy at panix.com
Mon Nov 19 15:59:19 CET 2012


OK, I've just read back over the whole thread.  I'm really struggling to 
understand what point you're trying to make.  I started out by saying:

> Use a list when you need an ordered collection which is mutable (i.e. 
> can be altered after being created).  Use a tuple when you need an 
> immutable list (such as for a dictionary key).

To which you obviously objected.  So now you write:

> I think a tuple is an immutable sequence of items, and a list is a 
> mutable sequence of items.

So how is that different from what I said?  Is this whole argument 
boiling down to your use of "immutable sequence" vs. my use of 
"immutable list"?


More information about the Python-list mailing list