Skip to content

Commit 57e065a

Browse files
Remove some unused constants, convert others to frozensets
1 parent 65e4a22 commit 57e065a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Lib/idlelib/colorizer.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@
1414

1515
DEBUG = False
1616

17-
18-
ANSI_ESCAPE_SEQUENCE = re.compile(r"\x1b\[[ -@]*[A-~]")
19-
ZERO_WIDTH_BRACKET = re.compile(r"\x01.*?\x02")
20-
ZERO_WIDTH_TRANS = str.maketrans({"\x01": "", "\x02": ""})
21-
IDENTIFIERS_AFTER = {"def", "class"}
22-
KEYWORD_CONSTANTS = {"True", "False", "None"}
23-
BUILTINS = {str(name) for name in dir(builtins) if not name.startswith('_')}
17+
IDENTIFIERS_AFTER = frozenset({"def", "class"})
18+
BUILTINS = frozenset({str(name) for name in dir(builtins) if not name.startswith('_')})
2419

2520

2621
class Span(NamedTuple):
@@ -76,8 +71,8 @@ def prev_next_window(iterable):
7671
yield tuple(window)
7772

7873

79-
keyword_first_sets_match = {"False", "None", "True", "await", "lambda", "not"}
80-
keyword_first_sets_case = {"False", "None", "True"}
74+
keyword_first_sets_match = frozenset({"False", "None", "True", "await", "lambda", "not"})
75+
keyword_first_sets_case = frozenset({"False", "None", "True"})
8176

8277

8378
def is_soft_keyword_used(*tokens):

0 commit comments

Comments
 (0)