diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-20 23:56:22 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-20 23:56:22 (GMT) |
commit | 0f44179422e2d3c470b267e207164efedfb9f26a (patch) | |
tree | 0f87feeb208fe40ead72fc2f68f2f6459c7d5495 | |
parent | a1864f371746e4273209fce055bb26eb43e822ef (diff) | |
download | cpython-0f44179422e2d3c470b267e207164efedfb9f26a.zip cpython-0f44179422e2d3c470b267e207164efedfb9f26a.tar.gz cpython-0f44179422e2d3c470b267e207164efedfb9f26a.tar.bz2 |
Document index and count as part of the Sequence ABC (#9746)
-rw-r--r-- | Doc/library/stdtypes.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f2bb99d..f960bab 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 |