On 22 June 2011 16:53, Andrew Berg <bahamutzero8...@gmail.com> wrote:
> On 2011.06.22 10:45 AM, Chetan Harjani wrote:
>> why tuples are immutable whereas list are mutable?
> Tuples are more efficient and more appropriate for a list of items that
> doesn't need to change.

And also it sometimes useful to be sure that something can't change.
In particular, efficient dictionary implementations need the keys to
be immutable, because it you change a key it /really/ fouls up the
look-up.

-- 
Tim Rowe
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to