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
Switch all string addition to using f-strings #1774
Conversation
58656f4
to
31515e4
Compare
Let's use pre-commit to enforce this |
@sfdye Good poiint, I'll add that in this PR, and then merge it when CI is happy again. |
Wait a second, how does pyupgrade enforce this? |
if you use the --python36 option, it will enforce f-string i think |
It doesn't enforce f-strings everywhere, just where it thinks they are better. ref. It would be good to use f-strings as much as possible, because they are faster. :) |
That's the more accurate way to put it 😄 |
31515e4
to
f3d27e1
Compare
Codecov Report
@@ Coverage Diff @@
## master #1774 +/- ##
=======================================
Coverage 98.76% 98.76%
=======================================
Files 51 51
Lines 2677 2678 +1
=======================================
+ Hits 2644 2645 +1
Misses 33 33
Continue to review full report at Codecov.
|
@sfdye pyupgrade did some far-reaching changes, but shall we merge this and cut a .1 release? |
The changes are not just f-string, more like applying pyupgrade on whole codebase. Could you update the PR title/description and add the commit sha our ignore list 😄 |
github/PaginatedList.py
Outdated
for element in self.__elements: | ||
yield element | ||
yield from self.__elements | ||
while self._couldGrow(): | ||
newElements = self._grow() | ||
for element in newElements: | ||
yield element |
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.
sweet
So the problem is, if we disentangle this, we get a bunch of changes that pyuppgrade makes calling .format(). I can try again if you wish. |
What is the problem? I don't understand |
Objection removed -- I'll push up a new PR with pyupgrade. Given the formative changes that it will introduce, like yield form, I don't think we should add it to .git-blame-ignore-revs |
I feel most changes (remove unicode literal, removing shebang/convert to f-string) are inconsequential |
f3d27e1
to
04f9c92
Compare
Now that we no longer support Python 3.5, stop using string addition everywhere it makes sense, and move to the best feature 3.6+ gives us, f-strings!
04f9c92
to
aa72d49
Compare
Now that we no longer support Python 3.5, move to the best feature 3.6+
gives us, f-strings! This will likely be a bit of a moving target if
older code gets merged.