[Python-checkins] cpython (merge default -> default): Merge

terry.reedy python-checkins at python.org
Sat Jan 14 05:48:28 CET 2012


http://hg.python.org/cpython/rev/ec95169055ab
changeset: 74375:ec95169055ab
parent: 74374:e6b0d9d209f2
parent: 74371:e2f11c6305ae
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Fri Jan 13 23:47:41 2012 -0500
summary:
 Merge
files:
 Doc/library/exceptions.rst | 3 +++
 Doc/reference/expressions.rst | 5 ++++-
 Doc/reference/simple_stmts.rst | 5 ++++-
 Doc/whatsnew/3.3.rst | 1 +
 4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -261,6 +261,9 @@
 raised, and the value returned by the function is used as the
 :attr:`value` parameter to the constructor of the exception.
 
+ .. versionchanged:: 3.3
+ Added ``value`` attribute and the ability for generator functions to
+ use it to return a value.
 
 .. exception:: SyntaxError
 
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -355,7 +355,7 @@
 garbage collected), the generator-iterator's :meth:`close` method will be
 called, allowing any pending :keyword:`finally` clauses to execute.
 
-When ``yield from expression`` is used, it treats the supplied expression as
+When ``yield from <expr>`` is used, it treats the supplied expression as
 a subiterator. All values produced by that subiterator are passed directly
 to the caller of the current generator's methods. Any values passed in with
 :meth:`send` and any exceptions passed in with :meth:`throw` are passed to
@@ -369,6 +369,9 @@
 :exc:`StopIteration`, or automatically when the sub-iterator is a generator
 (by returning a value from the sub-generator).
 
+ .. versionchanged:: 3.3
+ Added ``yield from <expr>`` to delegate control flow to a subiterator
+
 The parentheses can be omitted when the :keyword:`yield` expression is the
 sole expression on the right hand side of an assignment statement.
 
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -470,10 +470,13 @@
 garbage collected), the generator-iterator's :meth:`close` method will be
 called, allowing any pending :keyword:`finally` clauses to execute.
 
-When ``yield from expression`` is used, it treats the supplied expression as
+When ``yield from <expr>`` is used, it treats the supplied expression as
 a subiterator, producing values from it until the underlying iterator is
 exhausted.
 
+ .. versionchanged:: 3.3
+ Added ``yield from <expr>`` to delegate control flow to a subiterator
+
 For full details of :keyword:`yield` semantics, refer to the :ref:`yieldexpr`
 section.
 
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -224,6 +224,7 @@
 how they might be accessible from the global scope.
 
 Example with (non-bound) methods::
+
 >>> class C:
 ... def meth(self):
 ... pass
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /