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
Mypy has troubles figuring subtyping between callables and overloads, see e.g. #495, but in this case mypy is right. A function annotated as in your code supports calls like f() and f(42), but max fails, since there are at least two required arguments. So you should write:
Simple example:
I can use
max()
as a function of floats with variadic args, but mypy gives me an error:I have mypy v0.670, Python 3.7.2. It's reproducible on mypy-play: https://mypy-play.net/?gist=df78cea368c8240fa82c63d5546f8aae
The text was updated successfully, but these errors were encountered: