OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Using a coroutine as decorator

  • Thread starter Thread starter Amin Etesamian
  • Start date Start date
A

Amin Etesamian

Guest
in this scenario:

Code:
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?
<p>in this scenario:</p>

<pre><code>async def foo(f):
async def wrapper(*args, **kwargs):
return f(*args, **kwargs)
return wrapper

@foo
async def boo(*args, **kwargs):
pass
</code></pre>

<p>is the call to foo as a decorator for boo decorator an async call?</p>

<p>--First Edit:
Also how does one handle calling chain of coroutines as decorators?</p>
 

Latest posts

Top