]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add additional links and index entries for "argument" and "parameter".
authorChris Jerdonek <chris.jerdonek@gmail.com>
Tue, 25 Dec 2012 22:50:21 +0000 (14:50 -0800)
committerChris Jerdonek <chris.jerdonek@gmail.com>
Tue, 25 Dec 2012 22:50:21 +0000 (14:50 -0800)
This adds to the work done for issue #15990 (i.e. f44b8d69e5fc and the
commits referenced there).

Doc/faq/programming.rst
Doc/glossary.rst
Doc/reference/compound_stmts.rst
Doc/reference/expressions.rst

index 8e218c0029c86064cccd4c88657c2deebc60fbac..edee68af14023701af65fe5741a0a1a74e8074fc 100644 (file)
@@ -469,6 +469,10 @@ In the unlikely case that you care about Python versions older than 2.0, use
        apply(g, (x,)+args, kwargs)
 
 
+.. index::
+   single: argument; difference from parameter
+   single: parameter; difference from argument
+
 .. _faq-argument-vs-parameter:
 
 What is the difference between arguments and parameters?
index e742336d2935868f451184ee955d91549813af13..392a60cd94c11682bd63207f765d71944a477810 100644 (file)
@@ -245,8 +245,9 @@ Glossary
 
    function
       A series of statements which returns some value to a caller. It can also
-      be passed zero or more arguments which may be used in the execution of
-      the body. See also :term:`argument` and :term:`method`.
+      be passed zero or more :term:`arguments <argument>` which may be used in
+      the execution of the body. See also :term:`parameter`, :term:`method`,
+      and the :ref:`function` section.
 
    __future__
       A pseudo-module which programmers can use to enable new language features
index a86eb11f88016b78425ceca474f2e40269742018..4a616eb7a9b5fe27a87cf55263f1749773890128 100644 (file)
@@ -407,6 +407,9 @@ is equivalent to ::
       statement.
 
 
+.. index::
+   single: parameter; function definition
+
 .. _function:
 .. _def:
 
@@ -467,12 +470,15 @@ is equivalent to::
    def func(): pass
    func = f1(arg)(f2(func))
 
-.. index:: triple: default; parameter; value
-
-When one or more top-level parameters have the form *parameter* ``=``
-*expression*, the function is said to have "default parameter values."  For a
-parameter with a default value, the corresponding argument may be omitted from a
-call, in which case the parameter's default value is substituted.  If a
+.. index::
+   triple: default; parameter; value
+   single: argument; function definition
+
+When one or more top-level :term:`parameters <parameter>` have the form
+*parameter* ``=`` *expression*, the function is said to have "default parameter
+values."  For a parameter with a default value, the corresponding
+:term:`argument` may be omitted from a call, in which
+case the parameter's default value is substituted.  If a
 parameter has a default value, all following parameters must also have a default
 value --- this is a syntactic restriction that is not expressed by the grammar.
 
index e5955bfa5559be61a5fd8d38366d88597a2cfcfe..812fb70ed2ac23a8e3ace13fbd2fa851d678d16c 100644 (file)
@@ -667,17 +667,18 @@ upper bound and stride, respectively, substituting ``None`` for missing
 expressions.
 
 
+.. index::
+   object: callable
+   single: call
+   single: argument; call semantics
+
 .. _calls:
 
 Calls
 -----
 
-.. index:: single: call
-
-.. index:: object: callable
-
-A call calls a callable object (e.g., a function) with a possibly empty series
-of arguments:
+A call calls a callable object (e.g., a :term:`function`) with a possibly empty
+series of :term:`arguments <argument>`:
 
 .. productionlist::
    call: `primary` "(" [`argument_list` [","]
@@ -696,12 +697,15 @@ of arguments:
 A trailing comma may be present after the positional and keyword arguments but
 does not affect the semantics.
 
+.. index::
+   single: parameter; call semantics
+
 The primary must evaluate to a callable object (user-defined functions, built-in
 functions, methods of built-in objects, class objects, methods of class
 instances, and certain class instances themselves are callable; extensions may
 define additional callable object types).  All argument expressions are
 evaluated before the call is attempted.  Please refer to section :ref:`function`
-for the syntax of formal parameter lists.
+for the syntax of formal :term:`parameter` lists.
 
 If keyword arguments are present, they are first converted to positional
 arguments, as follows.  First, a list of unfilled slots is created for the