-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Drop Python 3.5; Require Python 3.6+; Replace old-school string formatting with f-strings #5388
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
Conversation
Note that there’s still discussion ongoing about when to drop Python 3.5. This pull request will have to wait until the discussion concludes. |
okay, no problem. :) |
@Iqrar99 We are moving forward with this PR. |
Pylint throws warning for using f-strings in loggers. I removed f-strings from loggers to pass lint check.
|
Codecov Report
@@ Coverage Diff @@
## master #5388 +/- ##
==========================================
+ Coverage 82.24% 82.26% +0.02%
==========================================
Files 12 12
Lines 2726 2724 -2
==========================================
- Hits 2242 2241 -1
+ Misses 484 483 -1
Continue to review full report at Codecov.
|
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 understand that this PR is intrusive, changing a large part of the codebase. I'd like to get approval from 2-3 committers before we merge this PR. An alternative is to merely allow f-strings in the future and keep old string formatting code as is. |
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.
It's just a feature, you can use it or don't. Alternatives are not going away or being obsoleted. I'm not sure what's the point of choosing one for the whole code base over the others. Is it a requirement that we need to choose it in the future for consistency?
I would love to use Python type hint. But that doesn't mean we will have a code base completely type hinted in future..
I changed my mind now. This PR ended up being quite intrusive, touching all Python files. Whole-sale change like this may introduce unintended breakage. |
I opened #5715 to replace this PR. |
Based on #5338 , I just replaced some old-school string formatting with f-strings because f-strings are readable, more concise, and less prone to error than other ways of formatting, and also faster.
It's still in progress.