Skip to content

Commit d89793e

Browse files
committed
Use f-strings
1 parent ae67b5a commit d89793e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bpython/keys.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def __setitem__(self, key, value):
5252

5353
# fill dispatch with letters
5454
for c in string.ascii_lowercase:
55-
cli_key_dispatch["C-%s" % c] = (
55+
cli_key_dispatch[f"C-{c}"] = (
5656
chr(string.ascii_lowercase.index(c) + 1),
57-
"^%s" % c.upper(),
57+
f"^{c.upper()}",
5858
)
5959

6060
for c in string.ascii_lowercase:
61-
urwid_key_dispatch["C-%s" % c] = "ctrl %s" % c
62-
urwid_key_dispatch["M-%s" % c] = "meta %s" % c
61+
urwid_key_dispatch[f"C-{c}"] = f"ctrl {c}"
62+
urwid_key_dispatch[f"M-{c}"] = f"meta {c}"
6363

6464
# fill dispatch with cool characters
6565
cli_key_dispatch["C-["] = (chr(27), "^[")
@@ -70,7 +70,7 @@ def __setitem__(self, key, value):
7070

7171
# fill dispatch with function keys
7272
for x in range(1, 13):
73-
cli_key_dispatch["F%d" % x] = ("KEY_F(%d)" % x,)
73+
cli_key_dispatch[f"F{x}"] = (f"KEY_F({x})",)
7474

7575
for x in range(1, 13):
76-
urwid_key_dispatch["F%d" % x] = "f%d" % x
76+
urwid_key_dispatch[f"F{x}"] = f"f{x}"

0 commit comments

Comments
 (0)