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
Technically, if you pass an empty iterable like [], then sum will return 0 (as an int!). So the Union is correct.
In addition, mypy currently doesn't (nor likely will it) have support for checking the length of a list like in your second example. See also #7626 for a related issue.
Also, mypy 0.740 was just released, so you may want to update :)
Using mypy 0.700 (no additional flags) on the following method:
results in:
Even if I add a check for an empty list:
the same exact error is raised.
Is this intended?
The text was updated successfully, but these errors were encountered: