count method only for lists?
Fred L. Drake, Jr.
fdrake at acm.org
Thu Aug 26 22:04:59 CEST 1999
Stuart Reynolds writes:
> Does anyone know why there the count method is only defined for mutable
> sequences (i.e. lists) and not strings and tuples? And for that matter,
> index too? It seems as though the Python Library Reference (22.214.171.124
> Mutable Sequence Types) only describes lists and not mutable sequence
Hmm, what mutable sequences are left out? Just off-hand, I can't
think of any other than lists in the core language.
Tuples and strings are definately *not* mutable, though I expect the
interesting methods will appear in Python 1.6. Barry Warsaw has
already done some work to implement string methods.
Fred L. Drake, Jr. <fdrake at acm.org>
Corporation for National Research Initiatives
More information about the Python-list