| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| yield 42 | ||
|
|
||
| cm = manager() | ||
| self.assertNotIsInstance(cm, typing.AsyncContextManager) |
There was a problem hiding this comment.
I'd add a test that also serves as an example of how to use AsyncContextManager (presumably in async with ...?
Sorry, something went wrong.
|
I was planning to do this after AbstractAsyncContextManager is merged into CPython (python/cpython#1412), but there's really no need to wait. The code looks good to me. It would be nice if this can make it into 3.6.2. |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
Implements: - python/typing#438 - python/cpython#360 python/cpython#1412, which adds contextlib.AbstractAsyncContextManager, has not yet been merged.
) Implements: - python/typing#438 - python/cpython#360 Note that python/cpython#1412, which adds contextlib.AbstractAsyncContextManager, has not yet been merged.
| Back | FazBrowse Home | New Git URL |
Asynchronous context managers are defined by PEP 492, but there is no corresponding generic abstract class in typing. This PR adds it for Python 3.5+.