transform a "normal" decorator in one for async functions

vito.detullio at gmail.com vito.detullio at gmail.com
Wed Sep 19 03:33:24 EDT 2018


Il giorno martedì 18 settembre 2018 17:36:16 UTC+2, vito.d... at gmail.com ha scritto:

> > > is there a way to "convert" a "normal" decorator in one that can handle async functions?
> > In general? No.
> Ouch.
> 
> I'm new to the "async" world, but so this mean that all of the (appliable) decorators present in the various libraries have to be "paired" with async versions?

I was also thinking: there are some decorator functions (and decorator functions factories) also in the stdlib (functools.wrap, property, classmethod ... you name it)
so this means that also we need to check each of them if is applyable to async functions?



More information about the Python-list mailing list