You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will find a related but different type problem if you add an extra line:
deff(x: int) ->str:
result=Noneifx>0:
result="larger"elifx<0:
result="smaller"returnresult# Incompatible return value type (got "Optional[str]", expected "str")
AFAICT, a local defined in a branch could be viewed as a Union of its proper type and Unbound. In which case the first example could raise a Mypy error about result being potentially unbound (as it is for x=0).
Thoughts?
The text was updated successfully, but these errors were encountered:
Mypy currently doesn't find any problem with the following code:
It will find a related but different type problem if you add an extra line:
AFAICT, a local defined in a branch could be viewed as a Union of its proper type and Unbound. In which case the first example could raise a Mypy error about result being potentially unbound (as it is for x=0).
Thoughts?
The text was updated successfully, but these errors were encountered: