diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-12-25 22:57:54 (GMT) |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-12-25 22:57:54 (GMT) |
commit | 32bbc1c396561bcfae07345cc297dd98fd640d10 (patch) | |
tree | 8d81638f9516a49603c8789d40e4f46b6354ea70 /Doc/reference | |
parent | 41dc9f3cd15e5184700e2d0fc67b9fef9241c7df (diff) | |
parent | b43099464a72ae36733cb1993771cc2b825df269 (diff) | |
download | cpython-32bbc1c396561bcfae07345cc297dd98fd640d10.zip cpython-32bbc1c396561bcfae07345cc297dd98fd640d10.tar.gz cpython-32bbc1c396561bcfae07345cc297dd98fd640d10.tar.bz2 |
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).
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/compound_stmts.rst | 14 | ||||
-rw-r--r-- | Doc/reference/expressions.rst | 18 |
2 files changed, 21 insertions, 11 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 6889176..d0d0646 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -417,6 +417,9 @@ is equivalent to :: statement. +.. index:: + single: parameter; function definition + .. _function: .. _def: @@ -478,11 +481,14 @@ is equivalent to :: 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 index e9bf5c5..f88709e 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -637,17 +637,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` [","] | `comprehension`] ")" @@ -665,11 +666,14 @@ 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 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 |