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
'Python %f' % version
or the format method
'Python {}'.format(version)
鈥攅xcept when the arguments involve unpacking:
'Python {} or {}`.format(*versions)
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:
a.py:1:0: W999: Not using f-string: f"Python {version}" (not-using-fstring)
What do you think?
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.
Most helpful comment
It seems reasonable to me. I just think that the message should be a convention instead of a warning.