Skip to content

Commit e06d506

Browse files
author
andrew.kuchling
committed
Add *,**,@ to index, as suggested by
http://farmdev.com/thoughts/24/what-does-the-def-star-variable-or-def-asterisk-parameter-syntax-do-in-python-/ The right entry type to use isn't clear; operator seems wrong, because *,**,@ aren't being used in expressions here. I put them as 'statement'; 'syntax' might be better. git-svn-id: http://svn.python.org/projects/python/trunk@62353 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 9656725 commit e06d506

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/reference/compound_stmts.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ when the function is called.
424424
The function definition does not execute the function body; this gets executed
425425
only when the function is called.
426426

427+
.. index::
428+
statement: @
429+
427430
A function definition may be wrapped by one or more :term:`decorator` expressions.
428431
Decorator expressions are evaluated when the function is defined, in the scope
429432
that contains the function definition. The result must be a callable, which is
@@ -464,6 +467,10 @@ as the default, and explicitly test for it in the body of the function, e.g.::
464467
penguin.append("property of the zoo")
465468
return penguin
466469

470+
.. index::
471+
statement: *
472+
statement: **
473+
467474
Function call semantics are described in more detail in section :ref:`calls`. A
468475
function call always assigns values to all parameters mentioned in the parameter
469476
list, either from position arguments, from keyword arguments, or from default

Doc/tutorial/controlflow.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ not done, the order in which the arguments are printed is undefined.
437437
Arbitrary Argument Lists
438438
------------------------
439439

440+
.. index::
441+
statement: *
442+
440443
Finally, the least frequently used option is to specify that a function can be
441444
called with an arbitrary number of arguments. These arguments will be wrapped
442445
up in a tuple. Before the variable number of arguments, zero or more normal
@@ -464,6 +467,9 @@ or tuple::
464467
>>> range(*args) # call with arguments unpacked from a list
465468
[3, 4, 5]
466469

470+
.. index::
471+
statement: **
472+
467473
In the same fashion, dictionaries can deliver keyword arguments with the ``**``\
468474
-operator::
469475

0 commit comments

Comments
 (0)