Skip to content

Commit 9841e1a

Browse files
committed
Merge.
2 parents 1b91b65 + 132fc25 commit 9841e1a

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

bpython/repl.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,8 @@ def complete(self, tab=False):
524524
if not self.argspec:
525525
return False
526526
else:
527-
# remove duplicates and restore order
528-
self.matches = sorted(set(matches), self.cmp_matches,
529-
self.key_matches)
527+
# remove duplicates
528+
self.matches = matches
530529

531530

532531
if len(self.matches) == 1 and not OPTS.auto_display_list:
@@ -537,19 +536,6 @@ def complete(self, tab=False):
537536
self.matches_iter.update(cw, self.matches)
538537
return True
539538

540-
@staticmethod
541-
def cmp_matches(a, b):
542-
if a.startswith(('__', '_')) and not b.startswith(('__', '_')):
543-
return 1
544-
elif b.startswith(('__', '_')) and not a.startswith(('__', '_')):
545-
return -1
546-
else:
547-
return cmp(a, b)
548-
549-
@staticmethod
550-
def key_matches(name):
551-
return name.rsplit('.')[-1]
552-
553539
def format_docstring(self, docstring, width, height):
554540
"""Take a string and try to format it into a sane list of strings to be
555541
put into the suggestion box."""

0 commit comments

Comments
 (0)