-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Enable --warn-unreachable in --strict in Mypy 2.0 #18078
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
Comments
To quote my comment from #17944
|
I was shocked and dismayed to learn in #18386 that
That certainly describes me, and I'm sure many others. It is obvious that there should be a flag to enable all checks. What that flag is named doesn't matter. There are two ways to do this:
Again, the name doesn't matter. But there should be a flag that enables all checks, and the current |
As far as whether |
No, it is not: #2376. Also related: #7767. Moreover, if we agree with the following
—then To be clear: I'm +1 on adding |
I think such a flag would really be helpful. I'm not sure I would enable it in my projects, but it would be interesting for checking once in a while. C rrently there are a lot of flags that are useful and almost nobody has them enabled. For example did you know But I'd rather have a flag that enables all of them, so I can turn them off if they are annoying. But at the moment I'm pretty sure almost nobody has enabled If people are struggling with My favorite solution for this would probably be to add most of these to |
I am in favor of enabling --warn-unreachable in --strict in Mypy, based on my experience with it, which has never had any false positives — but if an investigation like #17944 reveals too many false positives, then let those be fixed first, I suppose... I am in favor of adding --warn-unreachable to --strict as late as 2.0 if need be. However, the documentation of
I interpret this to mean that adding --warn-unreachable to --strict does not need to wait for a major version change. It can be done immediately, on a minor version change. (Contrast with enabling it by default for unadorned runs of mypy, which would presumably call for a major version increment.) Which means that this issue could be done instead: #11223 P.S.: On the generalized topic of making --strict even stricter: I support making --strict as strict as possible; that's what it's for, after all! I have too many thoughts along these lines to go into them exhaustively here. |
It is questionable why
--strict
does not just enable--warn-unreachable
. A lot of people probably think "I'm running--strict
, there's nothing else important to enable".@sobolevn told me to create this issue in #18076 (comment)
The text was updated successfully, but these errors were encountered: