From 16b3a90ff1df3a4a9adee4a1809265b76c949a03 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Thu, 2 Apr 2020 00:34:20 -0700 Subject: [PATCH 1/3] functools.singledispatchmethod: add __call__ for better results It doesn't actually have __call__, it does some descriptor stuff, but this makes things work. _SingleDispatchCallable has a __call__ too, which is what this mirrors. Fixes #3898 --- stdlib/3/functools.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/3/functools.pyi b/stdlib/3/functools.pyi index 3b57064dc8df..10469c183868 100644 --- a/stdlib/3/functools.pyi +++ b/stdlib/3/functools.pyi @@ -86,6 +86,7 @@ if sys.version_info >= (3, 8): def register(self, cls: Any, method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload def register(self, cls: Any, method: Callable[..., _T]) -> Callable[..., _T]: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... class cached_property(Generic[_T]): func: Callable[[Any], _T] From 7981982672caaaa1faa84276f93d3b36b53cfa32 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Thu, 2 Apr 2020 21:01:46 -0700 Subject: [PATCH 2/3] functools.singledispatchmethod: whitelist --- tests/stubtest_whitelists/py38.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index a1bc6b042394..78dab20a38d4 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -101,6 +101,7 @@ dis.stack_effect email.message.MIMEPart.as_string enum.Enum._generate_next_value_ functools.partialmethod.__get__ +functools.singledispatchmethod.__call__ # A lie to reflect that the descriptor get returns a callable gettext.install gettext.translation hmac.compare_digest From 63ef193991c023fcfaf1597b05d9795e5902f5a8 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Thu, 2 Apr 2020 21:23:08 -0700 Subject: [PATCH 3/3] Restart CI