ch17: update from book draft
This commit is contained in:
@@ -5,7 +5,7 @@ yielding.
|
||||
|
||||
"""
|
||||
|
||||
# BEGIN YIELD_DELEGATE_FIX
|
||||
# tag::YIELD_DELEGATE_FIX[]
|
||||
def f():
|
||||
def do_yield(n):
|
||||
yield n
|
||||
@@ -13,7 +13,7 @@ def f():
|
||||
while True:
|
||||
x += 1
|
||||
yield from do_yield(x)
|
||||
# END YIELD_DELEGATE_FIX
|
||||
# end::YIELD_DELEGATE_FIX[]
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('Invoking f() now produces a generator')
|
||||
|
||||
Reference in New Issue
Block a user