[Python-checkins] cpython (merge 3.2 -> 3.3): Merge from 3.2: add links and index entries for "argument" and "parameter."

chris.jerdonek python-checkins at python.org
Wed Dec 26 00:00:56 CET 2012


http://hg.python.org/cpython/rev/7a4a1fc6b3ee
changeset:   81052:7a4a1fc6b3ee
branch:      3.3
parent:      81045:73b24ee09e0a
parent:      81051:31e1f0b7f42e
user:        Chris Jerdonek <chris.jerdonek at gmail.com>
date:        Tue Dec 25 14:57:54 2012 -0800
summary:
  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).

files:
  Doc/faq/programming.rst          |   4 ++++
  Doc/glossary.rst                 |   5 +++--
  Doc/reference/compound_stmts.rst |  14 ++++++++++----
  Doc/reference/expressions.rst    |  18 +++++++++++-------
  4 files changed, 28 insertions(+), 13 deletions(-)


diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -313,6 +313,10 @@
        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?
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -240,8 +240,9 @@
 
    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
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -417,6 +417,9 @@
       statement.
 
 
+.. index::
+   single: parameter; function definition
+
 .. _function:
 .. _def:
 
@@ -478,11 +481,14 @@
    def func(): pass
    func = f1(arg)(f2(func))
 
-.. index:: triple: default; parameter; value
+.. index::
+   triple: default; parameter; value
+   single: argument; function definition
 
-When one or more 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
+When one or more :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 up until the "``*``" must also have a default
 value --- this is a syntactic restriction that is not expressed by the grammar.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -637,17 +637,18 @@
 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` [","] | `comprehension`] ")"
@@ -665,11 +666,14 @@
 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 all objects having a :meth:`__call__` method are callable).  All
 argument expressions are evaluated before the call is attempted.  Please refer
-to section :ref:`function` for the syntax of formal parameter lists.
+to section :ref:`function` for the syntax of formal :term:`parameter` lists.
 
 .. XXX update with kwonly args PEP
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list