mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
gh-134976: document the exception type that can be raised by s[i] (#134977)
This commit is contained in:
parent
1cb7163872
commit
158e5162bf
1 changed files with 4 additions and 1 deletions
|
|
@ -1018,7 +1018,7 @@ operations have the same priority as the corresponding numeric operations. [3]_
|
|||
| ``s * n`` or | equivalent to adding *s* to | (2)(7) |
|
||||
| ``n * s`` | itself *n* times | |
|
||||
+--------------------------+--------------------------------+----------+
|
||||
| ``s[i]`` | *i*\ th item of *s*, origin 0 | \(3) |
|
||||
| ``s[i]`` | *i*\ th item of *s*, origin 0 | (3)(9) |
|
||||
+--------------------------+--------------------------------+----------+
|
||||
| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |
|
||||
+--------------------------+--------------------------------+----------+
|
||||
|
|
@ -1150,6 +1150,9 @@ Notes:
|
|||
without copying any data and with the returned index being relative to
|
||||
the start of the sequence rather than the start of the slice.
|
||||
|
||||
(9)
|
||||
An :exc:`IndexError` is raised if *i* is outside the sequence range.
|
||||
|
||||
|
||||
.. _typesseq-immutable:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue