diff --git a/stubs/singledispatch/@tests/stubtest_allowlist.txt b/stubs/singledispatch/@tests/stubtest_allowlist.txt index d455fe6c1..b47df9e9a 100644 --- a/stubs/singledispatch/@tests/stubtest_allowlist.txt +++ b/stubs/singledispatch/@tests/stubtest_allowlist.txt @@ -1 +1,2 @@ -singledispatch.singledispatchmethod.__call__ # A lie to reflect that the descriptor get returns a callable +# Internal utils, we are not interested in them: +singledispatch.helpers diff --git a/stubs/singledispatch/METADATA.toml b/stubs/singledispatch/METADATA.toml index 1cc454093..e48ee2d14 100644 --- a/stubs/singledispatch/METADATA.toml +++ b/stubs/singledispatch/METADATA.toml @@ -1 +1,4 @@ version = "3.7.*" + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/singledispatch/singledispatch.pyi b/stubs/singledispatch/singledispatch.pyi index 59d201deb..bd3671473 100644 --- a/stubs/singledispatch/singledispatch.pyi +++ b/stubs/singledispatch/singledispatch.pyi @@ -2,6 +2,7 @@ from collections.abc import Callable, Mapping from typing import Any, Generic, TypeVar, overload _T = TypeVar("_T") +_S = TypeVar("_S") class _SingleDispatchCallable(Generic[_T]): registry: Mapping[Any, Callable[..., _T]] @@ -19,10 +20,12 @@ class singledispatchmethod(Generic[_T]): dispatcher: _SingleDispatchCallable[_T] func: Callable[..., _T] def __init__(self, func: Callable[..., _T]) -> None: ... + @property + def __isabstractmethod__(self) -> bool: ... @overload 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[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... - def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _S, cls: type[_S] | None = ...) -> Callable[..., _T]: ...