This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Documentation for pop in Built-in Types
Type: Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Dennis Sweeney, docs@python, lukasz.langa, mark-gluzman, miss-islington
Priority: normal Keywords: patch

Created on 2021-07-27 23:23 by mark-gluzman, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27398 merged Dennis Sweeney, 2021-07-28 01:15
PR 27412 merged miss-islington, 2021-07-28 13:32
PR 27413 merged miss-islington, 2021-07-28 13:32
PR 27414 merged miss-islington, 2021-07-28 13:32
Messages (3)
msg398329 - (view) Author: Mark Gluzman (mark-gluzman) Date: 2021-07-27 23:23
Python documentation: v.3.9.6 
The Python Standard Library >> Built-in Types >> Mutable Sequence Types

The table says that 'pop' operation should be written as 
s.pop([i]) 

The right way to do it is 
s.pop(i)
msg398336 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2021-07-28 01:02
The [square brackets] are used to denote *optional* arguments throughout the documentation. A tutorial page (https://docs.python.org/3/tutorial/controlflow.html#id1) has this to say:

    list.pop([i])

    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.)

I can open a PR to try to make the "Built-in Types" page you looked at a little clearer.
msg398386 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-07-28 13:57
Thanks, Dennis! ✨ 🍰 ✨
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88917
2021-07-28 13:57:48lukasz.langasetstatus: open -> closed

versions: + Python 3.8, Python 3.10, Python 3.11
nosy: + lukasz.langa

messages: + msg398386
resolution: fixed
stage: patch review -> resolved
2021-07-28 13:32:51miss-islingtonsetpull_requests: + pull_request25947
2021-07-28 13:32:42miss-islingtonsetpull_requests: + pull_request25946
2021-07-28 13:32:35miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25945
2021-07-28 01:15:29Dennis Sweeneysetkeywords: + patch
stage: patch review
pull_requests: + pull_request25931
2021-07-28 01:02:05Dennis Sweeneysetnosy: + Dennis Sweeney
messages: + msg398336
2021-07-27 23:23:07mark-gluzmancreate