asv
asv copied to clipboard
Use f-strings where possible
xref #909
Since we support Python > 3.7 now, we can make use of f-strings, to make code more readable.
As an example, the next asv
code:
machine_env_name = "{}/{}".format(machine, env_name)
or the next, which is equivalent:
machine_env_name = "{0}/{1}".format(machine, env_name)
Could be written as:
machine_env_name = f"{machine}/{env_name}"
(note the f
before the string quotes)
There are lots of those in the codebase. This would be good as something to work on during sprints, but we should create smaller issues, for specific files for those.
The next command returns the list of strings to replace: grep -R --exclude-dir="build" --exclude="*.css" ".format(" *
Refer to this example PR #1087
@datapythonista and @dorothykiz1 I'm going to work on this to create a couple of examples more for the sprint.
Closed by #1258.