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
{{ message }}
Repository navigation
mypy error: Cannot infer type argument 1 of "sum" #3889
This looks like a duplicate of #230. Here are two workarounds:
You can use a local variable to hold the empty list and annotate the variable (empty: List[int] = []) and pass the variable as the second argument to sum.
You can cast the empty list to the desired type: sum(foo, cast(List[int], []))
Activity
JukkaL commentedon Aug 30, 2017
This looks like a duplicate of #230. Here are two workarounds:
empty: List[int] = []) and pass the variable as the second argument tosum.sum(foo, cast(List[int], []))