Skip to content

Commit 6a5bcfe

Browse files
committed
there is no need to sort words in advance, we can just sort names later
1 parent bdf54ed commit 6a5bcfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyrepl/fancycompleter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def attr_matches(self, text):
100100
noprefix = '__'
101101
else:
102102
noprefix = None
103-
words = sorted(words)
104103
while True:
105104
for word in words:
106105
if (
@@ -131,6 +130,7 @@ def attr_matches(self, text):
131130
if prefix and prefix != attr:
132131
return [f'{expr}.{prefix}'] # autocomplete prefix
133132

133+
names.sort()
134134
if self.use_colors:
135135
return self.colorize_matches(names, values)
136136

0 commit comments

Comments
 (0)