mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-29756: Improve documentation for list methods that compare items by equality (GH-572)
This commit is contained in:
parent
004251059b
commit
b2d77175d1
2 changed files with 3 additions and 3 deletions
|
|
@ -1084,7 +1084,7 @@ accepts integers that meet the value restriction ``0 <= x <= 255``).
|
||||||
| | also removes it from *s* | |
|
| | also removes it from *s* | |
|
||||||
+------------------------------+--------------------------------+---------------------+
|
+------------------------------+--------------------------------+---------------------+
|
||||||
| ``s.remove(x)`` | remove the first item from *s* | \(3) |
|
| ``s.remove(x)`` | remove the first item from *s* | \(3) |
|
||||||
| | where ``s[i] == x`` | |
|
| | where ``s[i]`` is equal to *x* | |
|
||||||
+------------------------------+--------------------------------+---------------------+
|
+------------------------------+--------------------------------+---------------------+
|
||||||
| ``s.reverse()`` | reverses the items of *s* in | \(4) |
|
| ``s.reverse()`` | reverses the items of *s* in | \(4) |
|
||||||
| | place | |
|
| | place | |
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ objects:
|
||||||
.. method:: list.remove(x)
|
.. method:: list.remove(x)
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
Remove the first item from the list whose value is *x*. It is an error if
|
Remove the first item from the list whose value is equal to *x*. It is an error if
|
||||||
there is no such item.
|
there is no such item.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ objects:
|
||||||
.. method:: list.index(x[, start[, end]])
|
.. method:: list.index(x[, start[, end]])
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
Return zero-based index in the list of the first item whose value is *x*.
|
Return zero-based index in the list of the first item whose value is equal to *x*.
|
||||||
Raises a :exc:`ValueError` if there is no such item.
|
Raises a :exc:`ValueError` if there is no such item.
|
||||||
|
|
||||||
The optional arguments *start* and *end* are interpreted as in the slice
|
The optional arguments *start* and *end* are interpreted as in the slice
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue