8000 [3.14] gh-134976: document the exception type that can be raised by `… · python/cpython@483a462 · GitHub
[go: up one dir, main page]

Skip to content

Commit 483a462

Browse files
[3.14] gh-134976: document the exception type that can be raised by s[i] (GH-134977) (#135258)
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 949248d commit 483a462

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
@@ -1018,7 +1018,7 @@ operations have the same priority as the corresponding numeric operations. [3]_
10181018
| ``s * n`` or | equivalent to adding *s* to | (2)(7) |
10191019
| ``n * s`` | itself *n* times | |
10201020
+--------------------------+--------------------------------+----------+
1021-
| ``s[i]`` | *i*\ th item of *s*, origin 0 | \(3) |
1021+
| ``s[i]`` | *i*\ th item of *s*, origin 0 | (3)(9) |
10221022
+--------------------------+--------------------------------+----------+
10231023
| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |
10241024
+--------------------------+--------------------------------+----------+
@@ -1150,6 +1150,9 @@ Notes:
11501150
without copying any data and with the returned index being relative to
11511151
the start of the sequence rather than the start of the slice.
11521152

1153+
(9)
1154+
An :exc:`IndexError` is raised if *i* is outside the sequence range.
1155+
11531156

11541157
.. _typesseq-immutable:
11551158

0 commit comments

Comments
 (0)
< 28EB footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" >

Footer

© 2025 GitHub, Inc.
0