Skip to content

Commit a12b682

Browse files
committed
Add missing list methods. Found by Leonardo Pereira on docs@.
1 parent 2070e83 commit a12b682

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Doc/tutorial/datastructures.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ objects:
5454
will see this notation frequently in the Python Library Reference.)
5555

5656

57+
.. method:: list.clear()
58+
:noindex:
59+
60+
Remove all items from the list. Equivalent to ``del a[:]``.
61+
62+
5763
.. method:: list.index(x)
5864
:noindex:
5965

@@ -79,6 +85,12 @@ objects:
7985
Reverse the elements of the list in place.
8086

8187

88+
.. method:: list.copy()
89+
:noindex:
90+
91+
Return a shallow copy of the list. Equivalent to ``a[:]``.
92+
93+
8294
An example that uses most of the list methods::
8395

8496
>>> a = [66.25, 333, 333, 1, 1234.5]

0 commit comments

Comments
 (0)