On 29/09/20 4:19 pm, Ben Rudiak-Gould wrote:
it's worth mentioning that Haskell has tuples of length 0, 2, 3, ..., but no tuples of length 1. Tuples are meant for putting n values where 1 value is expected, and when n=1 you just put the value there.

To elaborate on that a bit, the length of a tuple is part of its
static type in Haskell. It's impossible to write a function that
takes a tuple of arbitrary length -- a function taking a 1-tuple
could only ever take a 1-tuple, so it might as well just take
the value directly.

Things are different in Python -- functions can operate on tuples
of varying lengths, so if 1-tuples didn't exist some things would
be a bit awkward.

Not sure what bearing this has, if any, on the indexing problem.

--
Greg
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/WIVEONL3NIY5XPJL5NZPCU4TZ5NAQRSZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to