Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32bbc1c

Browse files
committed
Merge from 3.2: add links and index entries for "argument" and "parameter."
This adds to the work done for issue #15990 (i.e. f44b8d69e5fc and the commits referenced there).
2 parents 41dc9f3 + b430994 commit 32bbc1c

4 files changed

Lines changed: 28 additions & 13 deletions

File tree

Doc/faq/programming.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ calling another function by using ``*`` and ``**``::
313313
g(x, *args, **kwargs)
314314

315315

316+
.. index::
317+
single: argument; difference from parameter
318+
single: parameter; difference from argument
319+
316320
.. _faq-argument-vs-parameter:
317321

318322
What is the difference between arguments and parameters?

Doc/glossary.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ Glossary
240240

241241
function
242242
A series of statements which returns some value to a caller. It can also
243-
be passed zero or more arguments which may be used in the execution of
244-
the body. See also :term:`argument` and :term:`method`.
243+
be passed zero or more :term:`arguments <argument>` which may be used in
244+
the execution of the body. See also :term:`parameter`, :term:`method`,
245+
and the :ref:`function` section.
245246

246247
__future__
247248
A pseudo-module which programmers can use to enable new language features

Doc/reference/compound_stmts.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ is equivalent to ::
417417
statement.
418418

419419

420+
.. index::
421+
single: parameter; function definition
422+
420423
.. _function:
421424
.. _def:
422425

@@ -478,11 +481,14 @@ is equivalent to ::
478481
def func(): pass
479482
func = f1(arg)(f2(func))
480483

481-
.. index:: triple: default; parameter; value
484+
.. index::
485+
triple: default; parameter; value
486+
single: argument; function definition
482487

483-
When one or more parameters have the form *parameter* ``=`` *expression*, the
484-
function is said to have "default parameter values." For a parameter with a
485-
default value, the corresponding argument may be omitted from a call, in which
488+
When one or more :term:`parameters <parameter>` have the form *parameter* ``=``
489+
*expression*, the function is said to have "default parameter values." For a
490+
parameter with a default value, the corresponding :term:`argument` may be
491+
omitted from a call, in which
486492
case the parameter's default value is substituted. If a parameter has a default
487493
value, all following parameters up until the "``*``" must also have a default
488494
value --- this is a syntactic restriction that is not expressed by the grammar.

Doc/reference/expressions.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,17 +637,18 @@ upper bound and stride, respectively, substituting ``None`` for missing
637637
expressions.
638638

639639

640+
.. index::
641+
object: callable
642+
single: call
643+
single: argument; call semantics
644+
640645
.. _calls:
641646

642647
Calls
643648
-----
644649

645-
.. index:: single: call
646-
647-
.. index:: object: callable
648-
649-
A call calls a callable object (e.g., a function) with a possibly empty series
650-
of arguments:
650+
A call calls a callable object (e.g., a :term:`function`) with a possibly empty
651+
series of :term:`arguments <argument>`:
651652

652653
.. productionlist::
653654
call: `primary` "(" [`argument_list` [","] | `comprehension`] ")"
@@ -665,11 +666,14 @@ of arguments:
665666
A trailing comma may be present after the positional and keyword arguments but
666667
does not affect the semantics.
667668

669+
.. index::
670+
single: parameter; call semantics
671+
668672
The primary must evaluate to a callable object (user-defined functions, built-in
669673
functions, methods of built-in objects, class objects, methods of class
670674
instances, and all objects having a :meth:`__call__` method are callable). All
671675
argument expressions are evaluated before the call is attempted. Please refer
672-
to section :ref:`function` for the syntax of formal parameter lists.
676+
to section :ref:`function` for the syntax of formal :term:`parameter` lists.
673677

674678
.. XXX update with kwonly args PEP
675679

0 commit comments

Comments
 (0)