On 6/05/20 1:58 pm, Henk-Jaap Wagenaar wrote:
I'd say the difference is just one of semantics and as a mathematician I would consider tuples and sequences as "isomorphic", in fact, the set-theoretical construction of tuples as functions is *identical* to the usual definition of sequences: i.e. they are just two interpretations of the the same object depending on your point of view.

Maybe the small subset of mathematicians that concern themselves
with trying to define everything in terms of sets, but I don't
think the majority of mathematicians think like that in their
everyday work. It's certainly at odds with the way I see tuples
and sequences being used in mathematics.

As well as the same type vs. different types thing, here are
some other salient differences:

- Infinite sequences make sense, infinite tuples not so much.

- Sequences are fundamentally ordered, whereas tuples are not
ordered in the same sense. Any apparent ordering in a tuple is
an artifact of the way we conventionally write them. If we were
in the habit of labelling the elements of a tuple and writing
things like (x:1, y:2, z:3) then we wouldn't have to write them
in any particular order -- (y:2, x:1, z:3) would be the same
tuple.

--
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/WK57NAP44HA7322U7XH3ERAGUJLNYOI6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to