From: Éric Araujo Date: Sat, 20 Nov 2010 23:56:22 +0000 (+0000) Subject: Document index and count as part of the Sequence ABC (#9746) X-Git-Tag: v3.2b1~273 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f44179422e2d3c470b267e207164efedfb9f26a;p=thirdparty%2FPython%2Fcpython.git Document index and count as part of the Sequence ABC (#9746) --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f2bb99d8e88d..f960bab11644 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -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