Skip to content

Commit 9a669d5

Browse files
pablogsalmiss-islington
authored andcommitted
bpo-39233: Update positional-only section in the glossary (GH-17874)
https://bugs.python.org/issue39233
1 parent 998c549 commit 9a669d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/glossary.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,11 @@ Glossary
824824
.. _positional-only_parameter:
825825

826826
* :dfn:`positional-only`: specifies an argument that can be supplied only
827-
by position. Python has no syntax for defining positional-only
828-
parameters. However, some built-in functions have positional-only
829-
parameters (e.g. :func:`abs`).
827+
by position. Positional-only parameters can be defined by including a
828+
``/`` character in the parameter list of the function definition after
829+
them, for example *posonly1* and *posonly2* in the following::
830+
831+
def func(posonly1, posonly2, /, positional_or_keyword): ...
830832

831833
.. _keyword-only_parameter:
832834

0 commit comments

Comments
 (0)