tuple.index()

Glenn Hutchings zondo42 at googlemail.com
Thu Dec 14 08:36:49 EST 2006


Simon Brunning wrote:
> It's because, philosophically, a Python tuple isn't just a read-only list.

But there are situations where you might want to treat it as a
read-only list.  E.g., an argument to a function, so that you can
guarantee the function won't modify it.  In that case, it makes sense
for the non-modifying methods (index() and count()) to be available.




More information about the Python-list mailing list