mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-114648: Add IndexError exception to tutorial datastructures list.pop entry (#114681)
Remove redundant explanation of optional argument.
This commit is contained in:
parent
586057e9f8
commit
57c3e775df
1 changed files with 3 additions and 4 deletions
|
@ -48,10 +48,9 @@ objects:
|
||||||
:noindex:
|
:noindex:
|
||||||
|
|
||||||
Remove the item at the given position in the list, and return it. If no index
|
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
|
is specified, ``a.pop()`` removes and returns the last item in the list.
|
||||||
square brackets around the *i* in the method signature denote that the parameter
|
It raises an :exc:`IndexError` if the list is empty or the index is
|
||||||
is optional, not that you should type square brackets at that position. You
|
outside the list range.
|
||||||
will see this notation frequently in the Python Library Reference.)
|
|
||||||
|
|
||||||
|
|
||||||
.. method:: list.clear()
|
.. method:: list.clear()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue