-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Enable mypy's strict equality checks #12209
Changes from all commits
7dd3eb5
9a9e557
2fcca55
9251589
dffdd14
8bee3dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,9 @@ | |
# Literal was introduced in Python 3.8. | ||
from typing import Literal | ||
|
||
ResolverVariant = Literal["resolvelib", "legacy"] | ||
ResolverVariant = Literal[ | ||
"resolvelib", "legacy", "2020-resolver", "legacy-resolver" | ||
] | ||
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be better to modify the code paths to enforce the "resolvelib" and "legacy" values consistently instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change locally, but I'm a little less sure of it. Maybe better to do in a separate PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! As long as you don't forget to file it. 🙃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a deal |
||
else: | ||
ResolverVariant = str | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change to setting strict=True and opting out of specific checks.
This effectively enables
strict_equality = True
and a couple other options that have less of a bearing on the pip codebase. See also https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options