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
main.py:4: error: Argument 2 to "next" has incompatible type "None"; expected "int" [arg-type]
This is incorrect as next(numbers, None) or 0 is always int.
All close variants, including assigning it to an intermediate variable, don't have this issue.
I can't think of an actual application where you would want to write code like this, but I figured it's an interesting interaction that might warrant investigation.
I couldn't find an open issue about this and I asked in Gitter.
The text was updated successfully, but these errors were encountered:
The following MWE (mypy-playground):
produces the following report on
master
:This is incorrect as
next(numbers, None) or 0
is alwaysint
.All close variants, including assigning it to an intermediate variable, don't have this issue.
I can't think of an actual application where you would want to write code like this, but I figured it's an interesting interaction that might warrant investigation.
I couldn't find an open issue about this and I asked in Gitter.
The text was updated successfully, but these errors were encountered: