From e6cf110100e957d1bd1aaba8847cf03838a4abb9 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 23 Jan 2022 23:38:09 +0300 Subject: [PATCH] Improve `FunctionType.__get__` with `@overload` (#7005) --- stdlib/types.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index a2926fac6..210b49f44 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -58,7 +58,10 @@ class FunctionType: closure: tuple[_Cell, ...] | None = ..., ) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, obj: object | None, type: type | None = ...) -> MethodType: ... + @overload + def __get__(self, obj: None, type: type) -> FunctionType: ... + @overload + def __get__(self, obj: object, type: type | None = ...) -> MethodType: ... LambdaType = FunctionType