◐ Shell
clean mode source ↗

Add AsyncContextManager generic class by ilevkivskyi · Pull Request #438 · python/typing

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@ilevkivskyi

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+.

Ivan Levkivskyi added 3 commits

June 9, 2017 14:45

gvanrossum

yield 42

cm = manager()
self.assertNotIsInstance(cm, typing.AsyncContextManager)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a test that also serves as an example of how to use AsyncContextManager (presumably in async with ...?

@JelleZijlstra

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.

@gvanrossum

JelleZijlstra added a commit to JelleZijlstra/typeshed that referenced this pull request

Jun 24, 2017

gvanrossum pushed a commit to python/typeshed that referenced this pull request

Jun 27, 2017

Labels