mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Fix the signature of decorator.contextmanager (#3330)
This commit is contained in:
committed by
Sebastian Rittau
parent
824e94a933
commit
0914d50b49
7
third_party/2and3/decorator.pyi
vendored
7
third_party/2and3/decorator.pyi
vendored
@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Pattern, Text, Tuple, TypeVar
|
||||
from typing import Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Pattern, Text, Tuple, TypeVar
|
||||
|
||||
_C = TypeVar("_C", bound=Callable[..., Any])
|
||||
_Func = TypeVar("_Func", bound=Callable[..., Any])
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def get_init(cls): ...
|
||||
|
||||
@@ -76,8 +77,8 @@ class FunctionMaker(object):
|
||||
def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ...
|
||||
def decorator(caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ...) -> Callable[[_C], _C]: ...
|
||||
|
||||
class ContextManager(_GeneratorContextManager[Any]):
|
||||
class ContextManager(_GeneratorContextManager[_T]):
|
||||
def __call__(self, func: _C) -> _C: ...
|
||||
|
||||
def contextmanager(func: _C) -> _C: ...
|
||||
def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ...
|
||||
def dispatch_on(*dispatch_args: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
|
||||
|
||||
Reference in New Issue
Block a user