Python asyncio version of nullcontext
If you are using context manager optionally in with
statement, you use
nullcontext
as option to not use context manager.
For example if you have function that can use external s3
boto client but create it if it’s not provided:
But what if context you are using is async one, like with aiobotocore:
There is no asyncio counterpart for nullcontext in Python.
But you can use AsyncExitStack: