mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Document index and count as part of the Sequence ABC (#9746)
This commit is contained in:
parent
a1864f3717
commit
0f44179422
1 changed files with 6 additions and 0 deletions
|
@ -876,6 +876,12 @@ are sequences of the same type; *n*, *i* and *j* are integers:
|
||||||
+------------------+--------------------------------+----------+
|
+------------------+--------------------------------+----------+
|
||||||
| ``max(s)`` | largest item of *s* | |
|
| ``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
|
Sequence types also support comparisons. In particular, tuples and lists are
|
||||||
compared lexicographically by comparing corresponding elements. This means that
|
compared lexicographically by comparing corresponding elements. This means that
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue