Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5809cae

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

1 file changed

+3-3Lines changed: 3 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/autocomplete.py‎

Copy file name to clipboardExpand all lines: bpython/autocomplete.py
+3-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.