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
Consider nudging users towards using f-strings #3592
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Comments
Seconded, especially since f-strings are a lot faster in practice as well. |
It seems reasonable to me. I just think that the message should be a convention instead of a warning. |
Pierre-Sassoulas
added
Good first issue
Friendly and approachable by new contributors
Help wanted 🙏
Outside help would be appreciated, good for new contributors
labels
Apr 24, 2021
4 tasks
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Aug 19, 2021
This adds a checker for normal strings which are formatted with `.format()` or '%'. The message is a convention to nudge users towards using f-strings. This closes pylint-dev#3592
DanielNoord
added a commit
to DanielNoord/pylint
that referenced
this issue
Aug 20, 2021
This adds a checker for normal strings which are formatted with ``.format()`` or '%'. The message is a convention to nudge users towards using f-strings. This closes pylint-dev#3592
Pierre-Sassoulas
added a commit
that referenced
this issue
Aug 30, 2021
* Add ``consider-using-f-string`` checker This adds a checker for normal strings which are formatted with ``.format()`` or '%'. The message is a convention to nudge users towards using f-strings. This closes #3592 * Update pylint code to use f-strings After adding `consider-using-f-strings` the codebase showed numerous cases of formatting which could be f-strings. This commit changes most of these to become f-strings, or adds ignores. * Apply suggestions from code review Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
return42
added a commit
to searxng/searxng
that referenced
this issue
Sep 17, 2021
Pylint 2.11 added [1][2] consider-using-f-string: Emitted when .format() or '%' is being used to format a string. We're not ready to enforce f-strings everywhere, so just disable this new warning. [1] https://pylint.pycqa.org/en/latest/whatsnew/2.11.html [2] pylint-dev/pylint#3592 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Python 3.5 is end-of-life in September 2020. Since Python 3.6 introduced f-strings, there is no good reason to interpolate literal strings with the string interpolation operator
or the
format
method—except when the arguments involve unpacking:
Can we consider a pylint warning to nudge users towards using f-strings when possible? It would be extremely helpful to write the f-string for them. For example:
What do you think?
The text was updated successfully, but these errors were encountered: