micropython: add micropython component
This commit is contained in:
16
components/language/micropython/tests/basics/async_def.py
Normal file
16
components/language/micropython/tests/basics/async_def.py
Normal file
@@ -0,0 +1,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')
|
Reference in New Issue
Block a user