How come tuples don't have an index method?

Tim Peters tim.one at home.com
Sat Sep 8 15:01:29 EDT 2001


[Tim]
> In 2.2, operator.countOf() works on any iterable object:

[Ralph Corderoy]
> Ugh.  Is this girlyCaps style common in Python?  I hadn't noticed it
> much before.

Guido usually uses underscores instead; other authors don't.

> Would be nice to be consistent, espcecially within a
> single module.

It's unusually common in the operator module:  countOf, indexOf, isCallable,
isMappingType, isNumberType, isSequenceType, sequenceIncludes.

> getitem isn't getItem so why not countof?

If you really believe there's an objective reason, and that you can convince
the author they were wrong, feel encouraged to find the author via CVS and
engage them in productive debate <wink>.





More information about the Python-list mailing list