1# yielding from an already executing generator is not allowed
2
3def f():
4    yield 1
5    # g here is already executing so this will raise an exception
6    yield from g
7
8g = f()
9
10print(next(g))
11
12try:
13    next(g)
14except ValueError:
15    print('ValueError')
16