X Tutup
Skip to content

Commit 5809cae

Browse files
committed
Use a set directly
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent e90b121 commit 5809cae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpython/autocomplete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def format(self, word):
112112
return self._completers[0].format(word)
113113

114114
def matches(self, cursor_offset, line, locals_, argspec, current_block, complete_magic_methods):
115-
all_matches = []
115+
all_matches = set()
116116
for completer in self._completers:
117117
# these have to be explicitely listed to deal with the different
118118
# signatures of various matches() methods of completers
@@ -123,9 +123,9 @@ def matches(self, cursor_offset, line, locals_, argspec, current_block, complete
123123
current_block=current_block,
124124
complete_magic_methods=complete_magic_methods)
125125
if matches is not None:
126-
all_matches.extend(matches)
126+
all_matches.update(matches)
127127

128-
return sorted(set(all_matches))
128+
return sorted(all_matches)
129129

130130

131131
class ImportCompletion(BaseCompletionType):

0 commit comments

Comments
 (0)
X Tutup