asyncstdlib
asyncstdlib copied to clipboard
Backport contextlib.AsyncContextDecorator and asynccontextmanager decorator feature
There is currently no support for contextlib.AsyncContextDecorator, which was added in Py3.10.
Also from the Python docs:
Changed in version 3.10: Async context managers created with asynccontextmanager() can be used as decorators.
This allows creating a context manager by decorating an async def fun with @asynccontextmanager, then decorating another function as @fun.
This should be back-ported to asyncstdlib, since we support Py3.8 and thus would add some value over the standard library implementation. Note that this is obsolete once we hit Py3.10 as the minimum supported version.