diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-01-13 11:43:40 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-01-13 11:43:40 (GMT) |
commit | 1f7ce62bd61488d5d721896a36a1b43befab88b5 (patch) | |
tree | e7c92d4429ce431c78d0b7816c93862629590223 /Doc/whatsnew | |
parent | e51757f6de9db71b7ee0a6cbf7dde62e9f146804 (diff) | |
download | cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.zip cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.tar.gz cpython-1f7ce62bd61488d5d721896a36a1b43befab88b5.tar.bz2 |
Implement PEP 380 - 'yield from' (closes #11682)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.3.rst | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 0b0f8f6..07257f0 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -195,6 +195,22 @@ inspection of exception attributes:: print("You are not allowed to read document.txt") +PEP 380: Syntax for Delegating to a Subgenerator +================================================ + +PEP 380 adds the ``yield from`` expression, allowing a generator to delegate +part of its operations to another generator. This allows a section of code +containing 'yield' to be factored out and placed in another generator. +Additionally, the subgenerator is allowed to return with a value, and the +value is made available to the delegating generator. +While designed primarily for use in delegating to a subgenerator, the ``yield +from`` expression actually allows delegation to arbitrary subiterators. + +(Implementation by Greg Ewing, integrated into 3.3 by Renaud Blanch, Ryan +Kelly and Nick Coghlan, documentation by Zbigniew Jędrzejewski-Szmek and +Nick Coghlan) + + PEP 3155: Qualified name for classes and functions ================================================== @@ -208,7 +224,6 @@ it provides better information about where they were actually defined, and how they might be accessible from the global scope. Example with (non-bound) methods:: - >>> class C: ... def meth(self): ... pass |