Skip to content

Commit 41e0d79

Browse files
ShivnarenSrinivasanaisk
authored andcommitted
pythongh-114648: Add IndexError exception to tutorial datastructures list.pop entry (python#114681)
Remove redundant explanation of optional argument.
1 parent 1bb3a32 commit 41e0d79

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Doc/tutorial/datastructures.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ objects:
4848
:noindex:
4949

5050
Remove the item at the given position in the list, and return it. If no index
51-
is specified, ``a.pop()`` removes and returns the last item in the list. (The
52-
square brackets around the *i* in the method signature denote that the parameter
53-
is optional, not that you should type square brackets at that position. You
54-
will see this notation frequently in the Python Library Reference.)
51+
is specified, ``a.pop()`` removes and returns the last item in the list.
52+
It raises an :exc:`IndexError` if the list is empty or the index is
53+
outside the list range.
5554

5655

5756
.. method:: list.clear()

0 commit comments

Comments
 (0)