bpo-29756: Improve documentation for list methods that compare items … · python/cpython@b2d7717 (original) (raw)
2 files changed
lines changed
| Original file line number | Diff line number | Diff line change | | | | | ---------------------------------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------- | -------------------------------- | ----- | | | @@ -1084,7 +1084,7 @@ accepts integers that meet the value restriction ``0 <= x <= 255``). | | | | | | | 1084 | 1084 | | | also removes it from *s* | | | | 1085 | 1085 | +------------------------------+--------------------------------+---------------------+ | | | | | 1086 | 1086 | | ``s.remove(x)`` | remove the first item from *s* | \(3) | | | 1087 | | -| | where ``s[i] == x`` | | | | | 1087 | +| | where ``s[i]`` is equal to *x* | | | | | 1088 | 1088 | +------------------------------+--------------------------------+---------------------+ | | | | | 1089 | 1089 | | ``s.reverse()`` | reverses the items of *s* in | \(4) | | | 1090 | 1090 | | | place | | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -40,7 +40,7 @@ objects: | ||
40 | 40 | .. method:: list.remove(x) |
41 | 41 | :noindex: |
42 | 42 | |
43 | - Remove the first item from the list whose value is *x*. It is an error if | |
43 | + Remove the first item from the list whose value is equal to *x*. It is an error if | |
44 | 44 | there is no such item. |
45 | 45 | |
46 | 46 | |
@@ -63,7 +63,7 @@ objects: | ||
63 | 63 | .. method:: list.index(x[, start[, end]]) |
64 | 64 | :noindex: |
65 | 65 | |
66 | - Return zero-based index in the list of the first item whose value is *x*. | |
66 | + Return zero-based index in the list of the first item whose value is equal to *x*. | |
67 | 67 | Raises a :exc:`ValueError` if there is no such item. |
68 | 68 | |
69 | 69 | The optional arguments *start* and *end* are interpreted as in the slice |