From: Georg Brandl Date: Sun, 6 Oct 2013 11:01:19 +0000 (+0200) Subject: Add missing list methods. Found by Leonardo Pereira on docs@. X-Git-Tag: v3.4.0a4~241^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a12b68203381b349effba8d442af4a98a74fbb3e;p=thirdparty%2FPython%2Fcpython.git Add missing list methods. Found by Leonardo Pereira on docs@. --- diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 53077e451a7b..24d2d2ec3aa3 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -54,6 +54,12 @@ objects: will see this notation frequently in the Python Library Reference.) +.. method:: list.clear() + :noindex: + + Remove all items from the list. Equivalent to ``del a[:]``. + + .. method:: list.index(x) :noindex: @@ -79,6 +85,12 @@ objects: Reverse the elements of the list in place. +.. method:: list.copy() + :noindex: + + Return a shallow copy of the list. Equivalent to ``a[:]``. + + An example that uses most of the list methods:: >>> a = [66.25, 333, 333, 1, 1234.5]