1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# test async def def dec(f): print('decorator') return f # test definition with a decorator @dec async def foo(): print('foo') coro = foo() try: coro.send(None) except StopIteration: print('StopIteration')