Decorators for Coroutines
Learn how to use decorators when working with asynchronous programming.
Difficulties with decorating coroutines
Since pretty much everything in Python is an object, pretty much anything can be decorated, and this includes coroutines as well. Coroutines are functions that can be suspended and resumed during execution, and are essential for enabling concurrency in programs.
However, there's a caveat here, and that is that asynchronous programming in Python introduces some differences in syntax. Therefore, these syntax differences will also be carried to the decorator. ...