tuple.index()

Nick Maclaren nmm1 at cus.cam.ac.uk
Thu Dec 14 10:57:22 EST 2006


In article <mailman.1605.1166111433.32031.python-list at python.org>,
"Fredrik Lundh" <fredrik at pythonware.com> writes:
|> 
|> > The point is that an index method makes sense on ANY data structure that
|> > can be subscripted by an integer value but, for reasons that aren't at
|> > all clear, is not defined for Python tuples.  There is no technical or
|> > mathematical reason why it shouldn't be.
|> 
|> so where would you put such an "index" implementation so it would work on
|> ANY data structure that can be subscripted by an integer value ?

In the same place you put the subscription method, clearly.  I really
don't see the problem.  I can see that it has not been done because
Guido and others felt that it wasn't worth doing, but not that it is
hard to do.


Regards,
Nick Maclaren.



More information about the Python-list mailing list