8000 futile attempt to improve _format_expr_name · python/mypy@c58bb6a · GitHub
[go: up one dir, main page]

Skip to content

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mypy/checker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,10 +3984,11 @@ def _format_expr_name(self, node: Node, t: Type):
39843984
if isinstance(node, RefExpr):
39853985
return f'"{node.fullname}" has type "{t}"'
39863986
elif isinstance(node, CallExpr):
3987-
if isinstance(node.callee, RefExpr):
3987+
if isinstance(node.callee, MemberExpr):
3988+
return f'"{node.callee.name}" returns "{t}"'
3989+
elif isinstance(node.callee, RefExpr) and node.callee.fullname:
39883990
return f'"{node.callee.fullname}" returns "{t}"'
3989-
else:
3990-
return f'call returns "{t}"'
3991+
return f'call returns "{t}"'
39913992
else:
39923993
return f'expression has type "{t}"'
39933994

0 commit comments

Comments
 (0)
0