From 0ca80b8cb50e083bf6d6fca2a00413302e0345b6 Mon Sep 17 00:00:00 2001 From: LeeeeT Date: Thu, 22 Aug 2024 19:47:22 +0300 Subject: [PATCH] Add `__call__` attribute to `function` --- stdlib/builtins.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 95335d241ea1..a0cca9751ce1 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -991,6 +991,7 @@ class function: __type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] __module__: str + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... # mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any. def __get__(self, instance: object, owner: type | None = None, /) -> Any: ...