pygount
pygount copied to clipboard
Replace `.format()` with f-strings
This issue aims to improve the readability and performance of the codebase by replacing .format() method calls with f-strings.
Python 3.6 introduced f-strings (formatted string literals), which provide a more concise and readable way to format strings compared to the .format() method. F-strings are also generally faster.
Identify all instances of .format() in the codebase and refactor them to use f-strings.
Notably, the LineWriter class in write.py uses .format() as the base of its template.
As the oldest Python version supported is 3.8, there is no need to retain .format().
There are only five ".format" calls total in the project:
So, it would not be difficult to replace them with modern f-strings.
Looks good, feel free to assign and implement this any time.