> The Cultural Difference is about how lists and tuples are actually used: lists are used where you have a homogenous sequence of unknown length; tuples are used where you know the number of elements in advance because the position of the element is semantically significant.
Oh, if only it were so simple! Python itself doesn't understand what the heck
tuples are, in that the built-in functions often treat tuples as simply
"immutable lists". See isinstance() and issubclass() functions, which expect
what's meant to be a list of classes, but you need to pass a tuple.
*args is another such example, as the article mentions.
If what Python calls tuples were the thing with structure instead of order,
they wouldn't be iterable.
Oh, if only it were so simple! Python itself doesn't understand what the heck tuples are, in that the built-in functions often treat tuples as simply "immutable lists". See isinstance() and issubclass() functions, which expect what's meant to be a list of classes, but you need to pass a tuple. *args is another such example, as the article mentions.
If what Python calls tuples were the thing with structure instead of order, they wouldn't be iterable.