Remove Redundant f-string
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery refactoring id: remove-redundant-fstring
Section titled “Sourcery refactoring id: remove-redundant-fstring”Description
Section titled “Description”If an f-string has no replacements turn it into a regular string.
Before
Section titled “Before”print(f"Why, oh why am I an f-string")print("Why, oh why am I an f-string")Explanation
Section titled “Explanation”Is not necessary to use an f-string that has no replacements so let’s keep it simple and just use a constant string.