How come tuples don't have an index method?

Ralph Corderoy ralph at inputplus.demon.co.uk
Mon Sep 10 06:41:30 EDT 2001


Hi Tim,

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

It's very much a minority in the operator module, and for two of
those...

    isCallable           deprecated since 2.0, use callable instead

    sequenceIncludes     deprecated since 2.0, use contains instead
        (contains added by Guido)

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

CVS only goes back to 2.1?  From that it looks like Guido did most of
it with Fred Drake making minor changes more recently.  But I can't
tell if many hands were involved before 2.1 leading to the mixture of
naming styles.

    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Modules/operator.c

Consistency is a nice attribute to have.  Not just in naming
conventions but also the interface a module presents.  Is effort needed
to improve the standard library so it's more consistent?  If so, would
that be welcomed?


Ralph.




More information about the Python-list mailing list