diff --git a/mypy/nodes.py b/mypy/nodes.py index d6102b1c19ae..8eb143f10bf5 100644 --- a/mypy/nodes.py +++ b/mypy/nodes.py @@ -2140,14 +2140,8 @@ def function_type(func: FuncBase, fallback: 'mypy.types.Instance') -> 'mypy.type for arg in fdef.arguments: names.append(arg.variable.name()) - if fdef.is_method() and not fdef.is_static and not fdef.is_class: - self_arg = [mypy.types.Instance(func.info, [])] # type: List[mypy.types.Type] - arg_types = self_arg + ([mypy.types.AnyType()] * (len(fdef.arguments) - 1)) - else: - arg_types = [mypy.types.AnyType()] * len(fdef.arguments) - return mypy.types.CallableType( - arg_types, + [mypy.types.AnyType()] * len(fdef.arguments), [arg.kind for arg in fdef.arguments], names, mypy.types.AnyType(), diff --git a/mypy/test/data/typexport-basic.test b/mypy/test/data/typexport-basic.test index 65a94ac05cb6..b284a35cdc1e 100644 --- a/mypy/test/data/typexport-basic.test +++ b/mypy/test/data/typexport-basic.test @@ -890,7 +890,7 @@ class A: def f(self): pass A.f [out] -MemberExpr(5) : def (self: A) -> Any +MemberExpr(5) : def (self: Any) -> Any [case testOverloadedUnboundMethod] ## MemberExpr @@ -914,7 +914,7 @@ class A: def f(self, x): pass A.f [out] -MemberExpr(8) : Overload(def (self: A) -> Any, def (self: A, x: Any) -> Any) +MemberExpr(8) : Overload(def (self: Any) -> Any, def (self: Any, x: Any) -> Any) [case testUnboundMethodWithInheritance] ## MemberExpr @@ -977,7 +977,7 @@ class A(Generic[t]): def f(self, x): pass A.f(None, None) [out] -MemberExpr(7) : def (self: A, x: Any) -> Any +MemberExpr(7) : def (self: Any, x: Any) -> Any [case testGenericMethodOfGenericClass] ## MemberExpr