diff --git a/stubs/3.2/contextlib.pyi b/stubs/3.2/contextlib.pyi index cebbfb13297d..af9f0ab2a21f 100644 --- a/stubs/3.2/contextlib.pyi +++ b/stubs/3.2/contextlib.pyi @@ -2,7 +2,14 @@ # NOTE: These are incomplete! -from typing import Any +from typing import Any, TypeVar, Generic # TODO more precise type? def contextmanager(func: Any) -> Any: ... + +_T = TypeVar('_T') + +class closing(Generic[_T]): + def __init__(self, thing: _T) -> None: ... + def __enter__(self) -> _T: ... + def __exit__(self, *exc_info) -> None: ...