PEP 806: Mixed sync/async context managers with precise async marking
Python allows the with and async with statements to handle multiple context managers in a single statement, so long as they are all respectively synchronous or asynchronous. When mixing synchronous and asynchronous context managers, developers must use deeply nested statements or use risky workarounds such as overuse of AsyncExitStack. ⌘ Read more

⤋ Read More