Add stub for contextlib.closing

This commit is contained in:
David
2015-08-31 07:36:04 +02:00
committed by Matthias Kramm
parent 4d39065569
commit 5c27ca2348

View File

@@ -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: ...