mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
bpo-39233: Update positional-only section in the glossary (GH-17874)
https://bugs.python.org/issue39233
This commit is contained in:
parent
998c54948a
commit
9a669d58e8
1 changed files with 5 additions and 3 deletions
|
@ -824,9 +824,11 @@ Glossary
|
||||||
.. _positional-only_parameter:
|
.. _positional-only_parameter:
|
||||||
|
|
||||||
* :dfn:`positional-only`: specifies an argument that can be supplied only
|
* :dfn:`positional-only`: specifies an argument that can be supplied only
|
||||||
by position. Python has no syntax for defining positional-only
|
by position. Positional-only parameters can be defined by including a
|
||||||
parameters. However, some built-in functions have positional-only
|
``/`` character in the parameter list of the function definition after
|
||||||
parameters (e.g. :func:`abs`).
|
them, for example *posonly1* and *posonly2* in the following::
|
||||||
|
|
||||||
|
def func(posonly1, posonly2, /, positional_or_keyword): ...
|
||||||
|
|
||||||
.. _keyword-only_parameter:
|
.. _keyword-only_parameter:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue