blob: 4158478cacf7b6d3832abfea0e48b12216299a7c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
except TypeError:
print("caught")
print(g.send(None))
print(g.send(100))
print(g.send(200))
|