diff options
author | Aarni Koskela <akx@iki.fi> | 2021-11-30 17:20:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 17:20:43 +0200 |
commit | fbe87acf96aab583975ed3371423eb20602eccaf (patch) | |
tree | b873c3356b9c96e826c4ab0bb3efc339a00838e4 /benchmarks/base.py | |
parent | 4db85ef574a64a2b230a3ae1ff19c9d04065a114 (diff) | |
download | redis-py-fbe87acf96aab583975ed3371423eb20602eccaf.tar.gz |
Pyupgrade + flynt + f-strings (#1759)
@akx Thank you so much for this! Thanks again for introducing me to a new tool that I'm sliding into my workflow as well.
Diffstat (limited to 'benchmarks/base.py')
-rw-r--r-- | benchmarks/base.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/benchmarks/base.py b/benchmarks/base.py index 8c13afe..519c9cc 100644 --- a/benchmarks/base.py +++ b/benchmarks/base.py @@ -34,12 +34,12 @@ class Benchmark: group_values = [group['values'] for group in self.ARGUMENTS] for value_set in itertools.product(*group_values): pairs = list(zip(group_names, value_set)) - arg_string = ', '.join(['%s=%s' % (p[0], p[1]) for p in pairs]) - sys.stdout.write('Benchmark: %s... ' % arg_string) + arg_string = ', '.join(f'{p[0]}={p[1]}' for p in pairs) + sys.stdout.write(f'Benchmark: {arg_string}... ') sys.stdout.flush() kwargs = dict(pairs) setup = functools.partial(self.setup, **kwargs) run = functools.partial(self.run, **kwargs) t = timeit.timeit(stmt=run, setup=setup, number=1000) - sys.stdout.write('%f\n' % t) + sys.stdout.write(f'{t:f}\n') sys.stdout.flush() |