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
--extra-checks was added per this review comment: #15425 (comment)
I think a big advantage of mypy relative to other type checkers is that it is relatively configurable. mypy's always had a number of config flags and the error code system that we've been encouraging allows users to enable and disable errors with granularity.
--extra-checks is not self-descriptive, it's not immediately obvious what it turns on or off. If I was a user and ran into a false positive/negative, I would not be able to connect it with the option. It's also part of --strict, so it's not even that extra — most users serious enough about type checking to know what the flag does will already have it on. I vote we keep --strict-concatenate and add --strict-typeddict-update. We can keep both of these as part of --strict and keep --extra-checks for backwards compatibility.
If we want to do more bundling of flags / error codes, I feel we should generalise --strict.
+1, Just had this issue with my decorator implementation and took me days to know it's because of --extra-checks enabled by --strict and the error message is not even helpful to understand:
There's no need to wait for mypy 2.0 to do this, since it will all be backwards compatible.
I wonder if these two checks could be refactored to produce specific error codes. In some sense that would be ideal, since we could promote --enable-error-code for them and regard the other flags as aliases for that.
Activity
sobolevn commentedon Nov 4, 2024
I agree, let's do that for [email protected]
SastaDev commentedon Dec 11, 2025
+1, Just had this issue with my decorator implementation and took me days to know it's because of
--extra-checksenabled by--strictand the error message is not even helpful to understand:Code:
Error:
wyattscarpenter commentedon Dec 12, 2025
There's no need to wait for mypy 2.0 to do this, since it will all be backwards compatible.
I wonder if these two checks could be refactored to produce specific error codes. In some sense that would be ideal, since we could promote --enable-error-code for them and regard the other flags as aliases for that.
Support per-module strict config
ilevkivskyi commentedon Jan 3, 2026
I think it was not a good idea to add
--extra-checks. Also cc @JukkaL