summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/async_def.py
blob: e345703d7473b8dfa1a82af2b2a7cf3b8a75fdfd (plain) (blame)
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')