Range Operation pre-PEP

Rainer Deyke root at rainerdeyke.com
Fri May 11 00:26:25 EDT 2001


"Douglas Alan" <nessus at mit.edu> wrote in message
news:lcd79gy3hl.fsf at gaffa.mit.edu...
> And what's that intent?  Ben claimed that tuples should only be used
> when you know how many elements there will be, and that lists should
> only be used for homogeneous data of unknown length.

And what a ridiculous claim that was.  Consider:

def f(*args):
  pass

'args' is a tuple.  A tuple is used precisely because you *don't* know in
advance how many elements there are.  Otherwise you would list the elements
individually.  The contents of 'args' are almost certainly homogeneous.

And what about the case where you want to use a homogeneous sequence, length
unknown, of arbitrary Python objects as a dictionary key>


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list