]> granicus.if.org Git - python/commitdiff
Document index and count as part of the Sequence ABC (#9746)
authorÉric Araujo <merwok@netwok.org>
Sat, 20 Nov 2010 23:56:22 +0000 (23:56 +0000)
committerÉric Araujo <merwok@netwok.org>
Sat, 20 Nov 2010 23:56:22 +0000 (23:56 +0000)
Doc/library/stdtypes.rst

index f2bb99d8e88d7629aee213c30378deeb52e4bad8..f960bab116445560639d9bcd90fea98a6de586a3 100644 (file)
@@ -876,6 +876,12 @@ are sequences of the same type; *n*, *i* and *j* are integers:
 +------------------+--------------------------------+----------+
 | ``max(s)``       | largest item of *s*            |          |
 +------------------+--------------------------------+----------+
+| ``s.index(i)``   | index of the first occurence   |          |
+|                  | of *i* in *s*                  |          |
++------------------+--------------------------------+----------+
+| ``s.count(i)``   | total number of occurences of  |          |
+|                  | *i* in *s*                     |          |
++------------------+--------------------------------+----------+
 
 Sequence types also support comparisons.  In particular, tuples and lists are
 compared lexicographically by comparing corresponding elements.  This means that