PythonExtra/tests/basics/gen_yield_from_send.py
Damien George 539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00

15 lines
215 B
Python

def gen():
print("sent:", (yield 1))
yield 2
def gen2():
print((yield from gen()))
g = gen2()
next(g)
print("yielded:", g.send("val"))
try:
next(g)
except StopIteration:
print("StopIteration")