8000 Add AsyncContextManager generic class by ilevkivskyi · Pull Request #438 · python/typing · GitHub
[go: up one dir, main page]

Skip to content

Add AsyncContextManager generic class #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 9, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
A real fix of import
  • Loading branch information
Ivan Levkivskyi committed Jun 9, 2017
commit 2cbdb1b07754b6cc3128c47e3e090b1cb76710fd
3 changes: 2 additions & 1 deletion src/typing.py
Original file line number Diff line number Diff line change
7A62 Expand Up @@ -10,6 +10,7 @@
import collections.abc as collections_abc
except ImportError:
import collections as collections_abc # Fallback for PY3.2.
import _collections_abc # Needed for private function _check_methods
try:
from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType
except ImportError:
Expand Down Expand Up @@ -1996,7 +1997,7 @@ async def __aexit__(self, exc_type, exc_value, traceback):
@classmethod
def __subclasshook__(cls, C):
if cls is AsyncContextManager:
return collections_abc._check_methods(C, "__aenter__", "__aexit__")
return _collections_abc._check_methods(C, "__aenter__", "__aexit__")
return NotImplemented

__all__.append('AsyncContextManager')
Expand Down
0