Tuple question

Donn Cave donn at drizzle.com
Mon Sep 6 01:48:33 EDT 2004


Quoth Bryan Olson <fakeaddress at nowhere.org>:
...
| Alas, that's ML, not Python.  Were that Python's designers'
| intent, why isn't it part of Python's design?  Why would we want
| to live within the confines of static typing, but without the
| safety and efficiency advantages of a type-checking compiler?

That is not what is homogeneous about a list.  That would indeed
be an absurd contradiction, so it should be easy to convince you
that it isn't how anyone proposes you should use a list.  So, what
do they mean?

A homogeneous sequence, in the sense that makes sense in Python,
is one where any slice is has the same functional meaning to the
application.  Of course the data is different and that can have
fundamental consequences, but it's different than (key, value)
for example where a[:] is the only slice that preserves its
meaning.

Whether it was a well chosen word for it or or not, this notion
of how lists are designed to be used, as opposed to tuples, is
evidently why there is no index() function.  That's all.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list