summaryrefslogtreecommitdiffstats
path: root/Doc/reference
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/compound_stmts.rst6
-rw-r--r--Doc/reference/simple_stmts.rst7
2 files changed, 11 insertions, 2 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 74833df..5b590ce 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -52,6 +52,7 @@ Summarizing:
: | `with_stmt`
: | `funcdef`
: | `classdef`
+ : | `decorated`
suite: `stmt_list` NEWLINE | NEWLINE INDENT `statement`+ DEDENT
statement: `stmt_list` NEWLINE | `compound_stmt`
stmt_list: `simple_stmt` (";" `simple_stmt`)* [";"]
@@ -424,6 +425,7 @@ A function definition defines a user-defined function object (see section
funcdef: [`decorators`] "def" `funcname` "(" [`parameter_list`] ")" ["->" `expression`]? ":" `suite`
decorators: `decorator`+
decorator: "@" `dotted_name` ["(" [`argument_list` [","]] ")"] NEWLINE
+ funcdef: "def" `funcname` "(" [`parameter_list`] ")" ":" `suite`
dotted_name: `identifier` ("." `identifier`)*
parameter_list: (`defparameter` ",")*
: ( "*" [`parameter`] ("," `defparameter`)*
@@ -585,6 +587,10 @@ implementation details.
:pep:`3129` - Class Decorators
+Class definitions, like function definitions, may be wrapped by one or
+more :term:`decorator` expressions. The evaluation rules for the
+decorator expressions are the same as for functions. The result must
+be a class object, which is then bound to the class name.
.. rubric:: Footnotes
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 1dc49f3..e149710 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -539,9 +539,13 @@ The :keyword:`continue` statement
:keyword:`continue` may only occur syntactically nested in a :keyword:`for` or
:keyword:`while` loop, but not nested in a function or class definition or
-:keyword:`finally` statement within that loop. [#]_ It continues with the next
+:keyword:`finally` clause within that loop. It continues with the next
cycle of the nearest enclosing loop.
+When :keyword:`continue` passes control out of a :keyword:`try` statement with a
+:keyword:`finally` clause, that :keyword:`finally` clause is executed before
+really starting the next loop cycle.
+
.. _import:
.. _from:
@@ -832,4 +836,3 @@ pre-existing bindings in the local scope.
.. [#] It may occur within an :keyword:`except` or :keyword:`else` clause. The
restriction on occurring in the :keyword:`try` clause is implementor's
laziness and will eventually be lifted.
-