in this scenario:
async def foo(f):
async def wrapper(*args, **kwargs):
return f(*args, **kwargs)
return wrapper
@foo
async def boo(*args, **kwargs):
pass
is the call to foo as a decorator for boo decorator an async call?
--First Edit: Also how does one handle calling chain of coroutines as decorators?
Here is an alternate approach using the
decorator
library (i.e.pip install decorator
first):Output:
Thanks to @blacknght's comment, considering
and
as two decorators, and
As the
foo
is wrapping thework
coroutine, the key is toawait
thefunc(*arg)
in both decorators.