mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 04:52:23 +08:00
Re-organize directory structure (#4971)
See discussion in #2491 Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
15
stubs/singledispatch/singledispatch.pyi
Normal file
15
stubs/singledispatch/singledispatch.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import Any, Callable, Generic, Mapping, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class _SingleDispatchCallable(Generic[_T]):
|
||||
registry: Mapping[Any, Callable[..., _T]]
|
||||
def dispatch(self, cls: Any) -> Callable[..., _T]: ...
|
||||
@overload
|
||||
def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
@overload
|
||||
def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def _clear_cache(self) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
|
||||
def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
|
||||
Reference in New Issue
Block a user