mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Fixes to ContextManager (#1249)
* add typing.ContextManager for 3.6+ only This fixes the easier part of #655. Would it make sense to add a generic typing.ContextManager that exists in any Python version? * update comment * fix argument types for ContextManager.__exit__ * add AsyncContextManager * add @asynccontextmanager * typing.ContextManager now always exists * back out async-related changes Will submit those in a separate PR later * fix import order * AbstractContextManager only exists in 3.6+ * AbstractContextManager -> ContextManager
This commit is contained in:
committed by
Matthias Kramm
parent
385b9c8b66
commit
7dd2f80194
@@ -3,12 +3,11 @@
|
||||
from typing import (
|
||||
Any, Callable, Dict, Iterable, Iterator, List, Optional, Pattern, Sequence,
|
||||
Set, FrozenSet, TextIO, Tuple, Type, TypeVar, Union, Generic,
|
||||
overload,
|
||||
overload, ContextManager
|
||||
)
|
||||
import logging
|
||||
import sys
|
||||
from types import ModuleType, TracebackType
|
||||
from contextlib import ContextManager
|
||||
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
Reference in New Issue
Block a user