aboutsummaryrefslogtreecommitdiff
path: root/tests/basics/generator-return.py
blob: a3ac88575ef66eef4232ff327e1919c9fdfaa734 (plain)
1
2
3
4
5
6
7
8
9
10
def gen():
    yield 1
    return 42

g = gen()
print(next(g))
try:
    print(next(g))
except StopIteration as e:
    print(repr(e))