On Thu, Oct 15, 2009 at 6:55 PM, Tim Golden <m...@timgolden.me.uk> wrote:
> It was added relatively recently, around Python 2.6 I think, > at least partly as an oh-ok-then reaction to everyone asking: > "how come lists have .index and .count and tuples don't?" > and neverending "tuples-are-immutable-lists-no-they-aren't-yes-they-are" > debate. > > Thanks Tim, that explains most things. Well, I thought to throw this out for fun: >>> listSet = set(dir(list)) >>> tupleSet = set(dir(tuple)) >>> listSet - tupleSet {'sort', 'insert', '__reversed__', 'reverse', 'extend', '__delitem__', 'remove', '__setitem__', '__iadd__', 'pop', 'append', '__imul__'} >>> tupleSet - listSet {'__getnewargs__'} That would explain the major differences... =] Cheers, Xav
-- http://mail.python.org/mailman/listinfo/python-list