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
Fixes#18386 (at least partly)
(edited)
In a first test run, in which I included checks against `None` in
`--strict-equality`, the Mypy primer gave hundreds of new
`comparison-overlap` reports. Many of them seem really helpful
(including those for the Mypy source code itself), because it is often
hard to tell if non-overlapping `None` checks are just remnants of
incomplete refactorings or can handle cases with corrupted data or
similar issues. As it was only a little effort, I decided to add the
option `--strict-equality-for-none` to Mypy, which is disabled even in
`--strict` mode. Other libraries could adjust to this new behaviour if
and when they want. If many of them do so, we could eventually enable
`--strict-equality-for-none` in `--strict` mode or even merge it with
`--strict-equality` later.
The remaining new true positives revealed by the Mypy primer are the
result of no longer excluding types with custom `__eq__` methods for
identity checks (which, in my opinion, makes sense even in case
`--strict-equality-for-none` would be rejected).
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments