How come tuples don't have an index method?

Mats Wichmann mats at laplaza.org
Mon Sep 17 07:36:01 EDT 2001


On Sat, 8 Sep 2001 15:01:29 -0400, "Tim Peters" <tim.one at home.com>
wrote:

:[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>.


Just glancing at that, it's irritating when that style is applied to a
preposition.  isCallable and isMappingType look fine, but indexOf
looks horrid.  Maybe the rule is, it you couldn't count it as a word
in your grammar school papers you shouldn't capitalize them in Python
(grin)




Mats Wichmann




More information about the Python-list mailing list