-
Notifications
You must be signed in to change notification settings - Fork 33
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
Codebase formatting with f-string
#50
Conversation
@LeStarch Damn, I was testing my fork with linters. As I broke a lot of things on my fork, |
The commit is still out there. Recovering it is the issue. |
If you checkout the merged pull-request branch, it should exist. Then you can make that a new branch. Or if you prefer, follow those instructions to fetch the PR. Then from a clean codebase:
This will migrate over exactly the above commit into a new off-devel branch |
I am not sure this will work, but I think it will. You should do these steps soon as eventually the repository will be garbage-collected and it will disappear. |
@LeStarch Since you were able to reopen it, do you have the option to merge it? In that case, I don't need to redo the PR and let you look at my different PRs, right ? |
I can, but it looks like CI still needs some fixes. |
@LeStarch Ok, there seems to be a problem on Black and then it seems to be related to the FPP installation. |
I have a fix for the Black/CI install issue. |
Only format not working. I am going to merge and push a reformat as a separate PR. This is to not lose the changes. |
@LeStarch Okay, nice what about my other PRs that suffered the same closing fate? Can you reopen them? |
Sorry, I did not realize there were more. |
Change Description
string.format()
withf-strings
ref%
string interpolation operator withf-strings
(only%s
operator) refRationale
According to the Python documentation, using the
%
operator to format strings can lead to "a variety of quirks that lead to a number of common errors."PEP 498 added F-strings to Python in version 3.6. F-strings are a versatile and powerful method of string formatting. Because the code looks more like the output, they make it shorter and more readable.
Testing/Review Recommendations
Future Work
Deals with operators other than
%s
like%d
.