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
This is a tough one. The problem is that this kind of error is pretty common in class hierarchies, and if we were to report Derived.a as an error because the parameter names don't match, I'm sure we'd get quite a few complaints. So I'm not sure what to do except propose that maybe this ought to be yet another strictness flag (but we already have too many of those).
PS. There's nothing special about underscores here -- mypy just doesn't care about the argument names. For inheritance it just checks whether the type of Base.a reduced to what can be expressed using Callable is a supertype of the type of Derived.a when reduced to a Callable.
The following code reports no errors with mypy but will fail at runtime:
The text was updated successfully, but these errors were encountered: