@@ -40,16 +40,34 @@ Glossary
4040 ABCs with the :mod: `abc ` module.
4141
4242 argument
43- A value passed to a function or method, assigned to a named local
44- variable in the function body. A function or method may have both
45- positional arguments and keyword arguments in its definition.
46- Positional and keyword arguments may be variable-length: ``* `` accepts
47- or passes (if in the function definition or call) several positional
48- arguments in a list, while ``** `` does the same for keyword arguments
49- in a dictionary.
43+ A value passed to a :term: `function ` (or :term: `method `) when calling the
44+ function. There are two types of arguments:
45+
46+ * :dfn: `keyword argument `: an argument preceded by an identifier (e.g.
47+ ``name= ``) in a function call or passed as a value in a dictionary
48+ preceded by ``** ``. For example, ``3 `` and ``5 `` are both keyword
49+ arguments in the following calls to :func: `complex `::
50+
51+ complex(real=3, imag=5)
52+ complex(**{'real': 3, 'imag': 5})
53+
54+ * :dfn: `positional argument `: an argument that is not a keyword argument.
55+ Positional arguments can appear at the beginning of an argument list
56+ and/or be passed as elements of an :term: `iterable ` preceded by ``* ``.
57+ For example, ``3 `` and ``5 `` are both positional arguments in the
58+ following calls::
59+
60+ complex(3, 5)
61+ complex(*(3, 5))
5062
51- Any expression may be used within the argument list, and the evaluated
52- value is passed to the local variable.
63+ Arguments are assigned to the named local variables in a function body.
64+ See the :ref: `calls ` section for the rules governing this assignment.
65+ Syntactically, any expression can be used to represent an argument; the
66+ evaluated value is assigned to the local variable.
67+
68+ See also the :term: `parameter ` glossary entry, the FAQ question on
69+ :ref: `the difference between arguments and parameters
70+ <faq-argument-vs-parameter>`, and :pep: `362 `.
5371
5472 attribute
5573 A value associated with an object which is referenced by name using
@@ -391,10 +409,7 @@ Glossary
391409 <sortinghowto>` for examples of how to create and use key functions.
392410
393411 keyword argument
394- Arguments which are preceded with a ``variable_name= `` in the call.
395- The variable name designates the local name in the function to which the
396- value is assigned. ``** `` is used to accept or pass a dictionary of
397- keyword arguments. See :term: `argument `.
412+ See :term: `argument `.
398413
399414 lambda
400415 An anonymous inline function consisting of a single :term: `expression `
@@ -516,12 +531,55 @@ Glossary
516531 (methods). Also the ultimate base class of any :term: `new-style
517532 class `.
518533
534+ parameter
535+ A named entity in a :term: `function ` (or method) definition that
536+ specifies an :term: `argument ` (or in some cases, arguments) that the
537+ function can accept. There are five types of parameters:
538+
539+ * :dfn: `positional-or-keyword `: specifies an argument that can be passed
540+ either :term: `positionally <argument> ` or as a :term: `keyword argument
541+ <argument> `. This is the default kind of parameter, for example *foo *
542+ and *bar * in the following::
543+
544+ def func(foo, bar=None): ...
545+
546+ * :dfn: `positional-only `: specifies an argument that can be supplied only
547+ by position. Python has no syntax for defining positional-only
548+ parameters. However, some built-in functions have positional-only
549+ parameters (e.g. :func: `abs `).
550+
551+ * :dfn: `keyword-only `: specifies an argument that can be supplied only
552+ by keyword. Keyword-only parameters can be defined by including a
553+ single var-positional parameter or bare ``* `` in the parameter list
554+ of the function definition before them, for example *kw_only1 * and
555+ *kw_only2 * in the following::
556+
557+ def func(arg, *, kw_only1, kw_only2): ...
558+
559+ * :dfn: `var-positional `: specifies that an arbitrary sequence of
560+ positional arguments can be provided (in addition to any positional
561+ arguments already accepted by other parameters). Such a parameter can
562+ be defined by prepending the parameter name with ``* ``, for example
563+ *args * in the following::
564+
565+ def func(*args, **kwargs): ...
566+
567+ * :dfn: `var-keyword `: specifies that arbitrarily many keyword arguments
568+ can be provided (in addition to any keyword arguments already accepted
569+ by other parameters). Such a parameter can be defined by prepending
570+ the parameter name with ``** ``, for example *kwargs * in the example
571+ above.
572+
573+ Parameters can specify both optional and required arguments, as well as
574+ default values for some optional arguments.
575+
576+ See also the :term: `argument ` glossary entry, the FAQ question on
577+ :ref: `the difference between arguments and parameters
578+ <faq-argument-vs-parameter>`, the :class: `inspect.Parameter ` class, the
579+ :ref: `function ` section, and :pep: `362 `.
580+
519581 positional argument
520- The arguments assigned to local names inside a function or method,
521- determined by the order in which they were given in the call. ``* `` is
522- used to either accept multiple positional arguments (when in the
523- definition), or pass several arguments as a list to a function. See
524- :term: `argument `.
582+ See :term: `argument `.
525583
526584 Python 3000
527585 Nickname for the Python 3.x release line (coined long ago when the release
0 commit comments