Update pep-478 and pep-479.
This commit is contained in:
parent
62971a8dd0
commit
ff8f094454
|
@ -60,6 +60,7 @@ Implemented / Final PEPs:
|
|||
* PEP 465, a new matrix multiplication operator
|
||||
* PEP 461, %-formatting for binary strings
|
||||
* PEP 471, os.scandir()
|
||||
* PEP 479, change StopIteration handling inside generators
|
||||
|
||||
Accepted PEPs:
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ Title: Change StopIteration handling inside generators
|
|||
Version: $Revision$
|
||||
Last-Modified: $Date$
|
||||
Author: Chris Angelico <rosuav@gmail.com>, Guido van Rossum <guido@python.org>
|
||||
Status: Accepted
|
||||
Status: Final
|
||||
Type: Standards Track
|
||||
Content-Type: text/x-rst
|
||||
Created: 15-Nov-2014
|
||||
|
@ -62,7 +62,7 @@ existent". Unfortunately while intentional use is rare, it is easy to
|
|||
stumble on these cases by accident::
|
||||
|
||||
import contextlib
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def transaction():
|
||||
print('begin')
|
||||
|
@ -73,7 +73,7 @@ stumble on these cases by accident::
|
|||
raise
|
||||
else:
|
||||
print('commit')
|
||||
|
||||
|
||||
def do_it():
|
||||
print('Refactored initial setup')
|
||||
yield # Body of with-statement is executed here
|
||||
|
@ -86,7 +86,7 @@ stumble on these cases by accident::
|
|||
# return
|
||||
raise StopIteration # This is wrong
|
||||
print('Should not be reached')
|
||||
|
||||
|
||||
for i in gene():
|
||||
print('main: i =', i)
|
||||
|
||||
|
|
Loading…
Reference in New Issue