it's annoying to see hundreds of Expression has type "Any"
errors on every line after the line with the actual error
#162
-
ie. a function signature changes, so the result where it's called becomes it would be cool if it only showed the error that's actually causing the issue instead of cluttering the output with hundreds of useless error messages any solution to this issue would need to be mindful not to cause another instance of #152 NB: only happens with overloads |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Current behavior: @overload
def foo(a: str) -> str: ...
@overload
def foo(a: int) -> int: ...
a = foo(None) # error, inferred type of a is Any
print(a) # Any? seems kinda sus potential behavior: @overload
def foo(a: str) -> str: ...
@overload
def foo(a: int) -> int: ...
a = foo(None) # error, inferred type of a is str
print(a) # str, that's not sus :) This is basically the way that TS behaves. |
Beta Was this translation helpful? Give feedback.
-
This issue describes the situation and solution: python/mypy/issues/12016 |
Beta Was this translation helpful? Give feedback.
This issue describes the situation and solution: python/mypy/issues/12016