Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0ed8019c
Commit
0ed8019c
authored
Jan 14, 2012
by
Nick Coghlan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add versionchanged notes for PEP 380
parent
2dfe6b00
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
Doc/library/exceptions.rst
Doc/library/exceptions.rst
+3
-0
Doc/reference/expressions.rst
Doc/reference/expressions.rst
+4
-1
Doc/reference/simple_stmts.rst
Doc/reference/simple_stmts.rst
+4
-1
No files found.
Doc/library/exceptions.rst
View file @
0ed8019c
...
...
@@ -261,6 +261,9 @@ The following exceptions are the exceptions that are usually raised.
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
...
...
Doc/reference/expressions.rst
View file @
0ed8019c
...
...
@@ -355,7 +355,7 @@ resumed before it is finalized (by reaching a zero reference count or by being
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 @@ the yield expression. It can be either set explicitly when raising
: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.
...
...
Doc/reference/simple_stmts.rst
View file @
0ed8019c
...
...
@@ -470,10 +470,13 @@ resumed before it is finalized (by reaching a zero reference count or by being
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
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment