summaryrefslogtreecommitdiffstats
path: root/Doc/library/array.rst
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2021-04-02 15:28:35 (GMT)
committerGitHub <noreply@github.com>2021-04-02 15:28:35 (GMT)
commitafd12650580725ac598b2845384771c14c4f952e (patch)
tree2290e54eaa5fdb75d0b0513f0e575c440150fafd /Doc/library/array.rst
parent240bcf82a11fe7433a61da70605e924c53b88096 (diff)
downloadcpython-afd12650580725ac598b2845384771c14c4f952e.zip
cpython-afd12650580725ac598b2845384771c14c4f952e.tar.gz
cpython-afd12650580725ac598b2845384771c14c4f952e.tar.bz2
bpo-31956: Add start and stop parameters to array.index() (GH-25059)
Co-Authored-By: Anders Lorentsen <Phaqui@gmail.com>
Diffstat (limited to 'Doc/library/array.rst')
-rw-r--r--Doc/library/array.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index ff3ec6b..18a768d 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -178,11 +178,15 @@ The following data items and methods are also supported:
array of some other type.
-.. method:: array.index(x)
+.. method:: array.index(x[, start[, stop]])
Return the smallest *i* such that *i* is the index of the first occurrence of
- *x* in the array.
+ *x* in the array. The optional arguments *start* and *stop* can be
+ specified to search for *x* within a subsection of the array. Raise
+ :exc:`ValueError` if *x* is not found.
+ .. versionchanged:: 3.10
+ Added optional *start* and *stop* parameters.
.. method:: array.insert(i, x)