Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8222

Re: what happens inside?

References <BANLkTim5-pusEdT2Qhm-0NJtbazLJMvxXA@mail.gmail.com> <4E020FDF.2010904@gmail.com>
Date 2011-06-22 17:08 +0100
Subject Re: what happens inside?
From Tim Rowe <digitig@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.287.1308758923.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 22 June 2011 16:53, Andrew Berg <bahamutzero8825@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: what happens inside? Tim Rowe <digitig@gmail.com> - 2011-06-22 17:08 +0100

csiph-web