Asynchronous context manager
问题 I have an asynchronous API which I'm using to connect and send mail to an SMTP server which has some setup and tear down to it. So it fits nicely into using a contextmanager from Python 3's contextlib . Though, I don't know if it's possible write because they both use the generator syntax to write. This might demonstrate the problem (contains a mix of yield-base and async-await syntax to demonstrate the difference between async calls and yields to the context manager). @contextmanager async