-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce error category [unsafe-overload]. #16060
Comments
Seems fine to me, please submit a PR. In general we should minimize use of the "misc" error code. One concern is about backward incompatibility: users who use |
So if |
We now have a feature where we can make new errors codes "subcodes" of other codes, so that people's existing (This change is a great suggestion by the way, thanks for taking it on.) |
fixes #16060 Co-authored-by: Alex Waygood <[email protected]>
Feature
Specifically, consider this example from the documentation [mypy-play]:
Pitch
misc
is too generic and makes it difficult to specifically disable this kind of error. I propose to give it a specific name likeunsafe-overload
.Due to the absence of
Intersection
andNot
, this check raises false positives in certain code, for example:Where
Vector
implements__iter__
. Obviously, what we really mean here is:Which is actually implicit by the ordering of overloads. The latter would not raise
unsafe-overload
, sinceIterable[Vector] & Not[Vector]
is not a subtype ofVector
. But since it can't be expressed in the current type system, there needs to be a simple way to silence this check.The text was updated successfully, but these errors were encountered: