Terry Reedy wrote:
On the other hand, Python indexes are a form of random access iterator, the top of the hierarchy.
The term "random access iterator" seems oxymoronic to me. Iteration is all about operating on things in sequence. If you're accessing elements arbitrarily, then you're not iterating.
Python, traditionally, only came with one mutable builtin sequence type, so the sort function was made a method of that type.
Also it probably operates rather more efficiently than a generic one would, as it doesn't have to go through a general mechanism to access elements, but can take advantage of its knowledge of the internal structure of a list. -- Greg -- http://mail.python.org/mailman/listinfo/python-list