Skip to content

Commit 7fceb6f

Browse files
committed
Filter out _ and __ functions unless the match specifically starts with #62
1 parent 665fd72 commit 7fceb6f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bpython/repl.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,16 @@ def complete(self, tab=False):
517517
if not self.argspec:
518518
return False
519519
else:
520+
# unless the first character is a _ filter out all attributes starting with a _
521+
if not cw.split('.')[-1].startswith('_'):
522+
matches = [match for match in matches if not
523+
match.split('.')[-1].startswith('_')]
524+
520525
# remove duplicates and restore order
521526
self.matches = sorted(set(matches), self.cmp_matches,
522527
self.key_matches)
523528

529+
524530
if len(self.matches) == 1 and not OPTS.auto_display_list:
525531
self.list_win_visible = True
526532
self.tab()

0 commit comments

Comments
 (0)