mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
functools: add type argument to Type annotation (#4977)
Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
@@ -91,14 +91,14 @@ class _SingleDispatchCallable(Generic[_T]):
|
||||
# @fun.register(complex)
|
||||
# def _(arg, verbose=False): ...
|
||||
@overload
|
||||
def register(self, cls: type, func: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register(self, cls: Type[Any], func: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
# @fun.register
|
||||
# def _(arg: int, verbose=False):
|
||||
@overload
|
||||
def register(self, cls: Callable[..., _T], func: None = ...) -> Callable[..., _T]: ...
|
||||
# fun.register(int, lambda x: x)
|
||||
@overload
|
||||
def register(self, cls: Type, func: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def register(self, cls: Type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def _clear_cache(self) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
|
||||
@@ -110,11 +110,11 @@ if sys.version_info >= (3, 8):
|
||||
func: Callable[..., _T]
|
||||
def __init__(self, func: Callable[..., _T]) -> None: ...
|
||||
@overload
|
||||
def register(self, cls: Type, method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register(self, cls: Type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
@overload
|
||||
def register(self, cls: Callable[..., _T], method: None = ...) -> Callable[..., _T]: ...
|
||||
@overload
|
||||
def register(self, cls: Type, method: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def register(self, cls: Type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
class cached_property(Generic[_T]):
|
||||
func: Callable[[Any], _T]
|
||||
|
||||
Reference in New Issue
Block a user