From 72fbc459a7930a25f3453324c826b626c2bae034 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Wed, 26 Jul 2017 18:38:27 +0300 Subject: [PATCH] Add __init__ to types.MethodType (#1499) --- stdlib/2/types.pyi | 3 ++- stdlib/3/types.pyi | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/2/types.pyi b/stdlib/2/types.pyi index e4df50d8e..87380b324 100644 --- a/stdlib/2/types.pyi +++ b/stdlib/2/types.pyi @@ -81,10 +81,11 @@ class ClassType: ... class UnboundMethodType: im_class = ... # type: type im_func = ... # type: FunctionType - im_self = ... # type: Optional[object] + im_self = ... # type: object __name__ = ... # type: str __func__ = im_func __self__ = im_self + def __init__(self, func: Callable, obj: object) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... class InstanceType: diff --git a/stdlib/3/types.pyi b/stdlib/3/types.pyi index 9894742a3..f9f46c5fd 100644 --- a/stdlib/3/types.pyi +++ b/stdlib/3/types.pyi @@ -140,6 +140,7 @@ class MethodType: __func__ = ... # type: _StaticFunctionType __self__ = ... # type: object __name__ = ... # type: str + def __init__(self, func: Callable, obj: object) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... class BuiltinFunctionType: __self__ = ... # type: Union[object, ModuleType]