Skip to content

Commit 47a828e

Browse files
[3.13] gh-134976: document the exception type that can be raised by s[i] (GH-134977) (#135259)
gh-134976: document the exception type that can be raised by `s[i]` (GH-134977) (cherry picked from commit 158e516) Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
1 parent e5d1771 commit 47a828e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ operations have the same priority as the corresponding numeric operations. [3]_
976976
| ``s * n`` or | equivalent to adding *s* to | (2)(7) |
977977
| ``n * s`` | itself *n* times | |
978978
+--------------------------+--------------------------------+----------+
979-
| ``s[i]`` | *i*\ th item of *s*, origin 0 | \(3) |
979+
| ``s[i]`` | *i*\ th item of *s*, origin 0 | (3)(9) |
980980
+--------------------------+--------------------------------+----------+
981981
| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |
982982
+--------------------------+--------------------------------+----------+
@@ -1108,6 +1108,9 @@ Notes:
11081108
without copying any data and with the returned index being relative to
11091109
the start of the sequence rather than the start of the slice.
11101110

1111+
(9)
1112+
An :exc:`IndexError` is raised if *i* is outside the sequence range.
1113+
11111114

11121115
.. _typesseq-immutable:
11131116

0 commit comments

Comments
 (0)