Skip to content

Commit 3913640

Browse files
committed
Use frozenset for module level attributes
1 parent 4c0d7bc commit 3913640

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/_pyrepl/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
ANSI_ESCAPE_SEQUENCE = re.compile(r"\x1b\[[ -@]*[A-~]")
2020
ZERO_WIDTH_BRACKET = re.compile(r"\x01.*?\x02")
2121
ZERO_WIDTH_TRANS = str.maketrans({"\x01": "", "\x02": ""})
22-
IDENTIFIERS_AFTER = {"def", "class"}
23-
KEYWORD_CONSTANTS = {"True", "False", "None"}
24-
BUILTINS = {str(name) for name in dir(builtins) if not name.startswith('_')}
22+
IDENTIFIERS_AFTER = frozenset({"def", "class"})
23+
KEYWORD_CONSTANTS = frozenset({"True", "False", "None"})
24+
BUILTINS = frozenset({str(name) for name in dir(builtins) if not name.startswith('_')})
2525

2626

2727
def THEME(**kwargs):
@@ -220,8 +220,8 @@ def gen_colors_from_token_stream(
220220
yield ColorSpan(span, "builtin")
221221

222222

223-
keyword_first_sets_match = {"False", "None", "True", "await", "lambda", "not"}
224-
keyword_first_sets_case = {"False", "None", "True"}
223+
keyword_first_sets_match = frozenset({"False", "None", "True", "await", "lambda", "not"})
224+
keyword_first_sets_case = frozenset({"False", "None", "True"})
225225

226226

227227
def is_soft_keyword_used(*tokens: TI | None) -> bool:

0 commit comments

Comments
 (0)