[issue44754] Documentation for pop in Built-in Types

Dennis Sweeney report at bugs.python.org
Tue Jul 27 21:02:05 EDT 2021


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

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.

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44754>
_______________________________________


More information about the Python-bugs-list mailing list