-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add Applicability to pyupgrade #5162
Add Applicability to pyupgrade #5162
Conversation
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
I'd vote to make all of the "manual" fixes here "suggested". Users will need to opt-in to fixing them anyway. I think we should reserve "manual" for cases in which the fix is likely to be incorrect as-is. |
My only worry there is that the user may not know that it's version-gated. I believe we have a way to check the Python version a user is running and emit diagnostics that way - should I add those checks to the rules in question here and change to suggested? @charliermarsh |
I believe all of those rules are properly gated already though (or they apply to all versions >= Python 3.7). |
Ahhh gotcha, I didn't see any gates so I wanted to be safe. I'll change these back. Out of curiosity, where does that gating occur? |
It depends on the rule. Some of these are applicable to all supported versions (>= 3.7), so we don't need to gate at all. Other pyupgrade rules are gated in |
Done - thanks for the suggestion @charliermarsh ! |
(Looks like there's a small merge conflict.) |
6bfcb1a
to
04a7072
Compare
Summary
Fixes some of #4184. The
manual
fixes here are because they involve deprecations and I'm hesitant to classify version-based fixes as automatic/suggested if they cause a regression in the user's code.Test Plan