8000 Do it differently, per Jukka's suggestion. · python/mypy@55ba0ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 55ba0ed

Browse files
author
Guido van Rossum
committed
Do it differently, per Jukka's suggestion.
1 parent 1ddb04a commit 55ba0ed

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

mypy/checkexpr.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ def visit_call_expr(self, e: CallExpr) -> Type:
132132
# It's really a special form that only looks like a call.
133133
return self.accept(e.analyzed, self.chk.type_context[-1])
134134
self.try_infer_partial_type(e)
135-
self.accept(e.callee)
136-
# Access callee type directly, since accept may return the Any type
137-
# even if the type is known (in a dynamically typed function). This
138-
# way we get a more precise callee in dynamically typed functions.
139-
callee_type = self.chk.type_map[e.callee]
135+
callee_type = self.accept(e.callee)
140136
if (self.chk.disallow_untyped_calls and
141137
self.chk.typing_mode_full() and
142138
isinstance(callee_type, CallableType)
@@ -238,9 +234,8 @@ def check_call(self, callee: Type, args: List[Node],
238234
arg_types = self.infer_arg_types_in_context2(
239235
callee, args, arg_kinds, formal_to_actual)
240236

241-
if not self.chk.typing_mode_none():
242-
self.check_argument_count(callee, arg_types, arg_kinds,
243-
arg_names, formal_to_actual, context, self.msg)
237+
self.check_argument_count(callee, arg_types, arg_kinds,
238+
arg_names, formal_to_actual, context, self.msg)
244239

245240
self.check_argument_types(arg_types, arg_kinds, callee,
246241
formal_to_actual, context,

0 commit comments

Comments
 (0)
0