mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Revert "Improve typing of 2.7/contextlib::contextmanager."
This reverts commit 76c3a5bab0.
This commit is contained in:
@@ -2,16 +2,13 @@
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any, TypeVar, Callable, Generic, Iterator
|
||||
from typing import Any, TypeVar, Generic
|
||||
|
||||
# TODO more precise type?
|
||||
def contextmanager(func: Any) -> Any: ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class _GeneratorContextManager(Generic[_T]):
|
||||
def __enter__(self) -> _T: ...
|
||||
def __exit__(self, *exc_info) -> None: ...
|
||||
|
||||
def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., _GeneratorContextManager[_T]]: ...
|
||||
|
||||
class closing(Generic[_T]):
|
||||
def __init__(self, thing: _T) -> None: ...
|
||||
def __enter__(self) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user