fix subclassing ExitStack (#1810)

This commit is contained in:
Elliott Beach
2018-01-08 08:02:30 -06:00
committed by Matthias Kramm
parent db6e2a637b
commit 688f813457

View File

@@ -53,6 +53,8 @@ if sys.version_info >= (3,):
class ContextDecorator:
def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ...
_U = TypeVar('_U', bound='ExitStack')
class ExitStack(ContextManager[ExitStack]):
def __init__(self) -> None: ...
def enter_context(self, cm: ContextManager[_T]) -> _T: ...
@@ -61,3 +63,4 @@ if sys.version_info >= (3,):
*args: Any, **kwds: Any) -> Callable[..., None]: ...
def pop_all(self) -> ExitStack: ...
def close(self) -> None: ...
def __enter__(self: _U) -> _U: ...