count method only for lists?

Fred L. Drake, Jr. fdrake at acm.org
Thu Aug 26 16:04:59 EDT 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 (2.1.5.2
 > 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

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list