diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-02-01 03:52:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 03:52:58 (GMT) |
commit | 09b8b14e05557304ab12870137181685c2dcbe25 (patch) | |
tree | 9f464dbc76795517f4e1469e88e7020f5b99cb04 /Doc/tutorial | |
parent | c26decab6f96920bfa3a149d93dd50670fdb5a36 (diff) | |
download | cpython-09b8b14e05557304ab12870137181685c2dcbe25.zip cpython-09b8b14e05557304ab12870137181685c2dcbe25.tar.gz cpython-09b8b14e05557304ab12870137181685c2dcbe25.tar.bz2 |
[3.12] gh-114648: Add IndexError exception to tutorial datastructures list.pop entry (GH-114681) (#114841)
Remove redundant explanation of optional argument.
(cherry picked from commit 57c3e775df5a5ca0982adf15010ed80a158b1b80)
Co-authored-by: srinivasan <shivnaren@gmail.com>
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/datastructures.rst | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 87614d0..de28274 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -48,10 +48,9 @@ objects: :noindex: Remove the item at the given position in the list, and return it. If no index - is specified, ``a.pop()`` removes and returns the last item in the list. (The - square brackets around the *i* in the method signature denote that the parameter - is optional, not that you should type square brackets at that position. You - will see this notation frequently in the Python Library Reference.) + is specified, ``a.pop()`` removes and returns the last item in the list. + It raises an :exc:`IndexError` if the list is empty or the index is + outside the list range. .. method:: list.clear() |