tuples, index method, Python's design

Paul Rubin http
Fri Apr 13 22:29:39 EDT 2007


Steve Holden <steve at holdenweb.com> writes:
> This is just a bald restatement of the same argument you feel makes it
> desirable to add an index() method to tuples. If taken to its logical
> (and ridiculous) extreme there should only be one sequence type in
> Python.

That doesn't sound ridiculous given type/class unification.  There
could be a single sequence class that implements functions like index.
Subclasses like strings, tuples, lists, etc. would inherit from it.
Some of them might have optimized or customized implementations of
those standard operations, others might not.



More information about the Python-list mailing list