Skip to content

Commit 2418acf

Browse files
pep8 autocomplete.py
1 parent e73c30c commit 2418acf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bpython/autocomplete.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
def after_last_dot(name):
7575
return name.rstrip('.').rsplit('.')[-1]
7676

77+
7778
def few_enough_underscores(current, match):
7879
"""Returns whether match should be shown based on current
7980
@@ -139,8 +140,9 @@ def matches(self, cursor_offset, line, **kwargs):
139140
def locate(self, cursor_offset, line):
140141
"""Returns a Linepart namedtuple instance or None given cursor and line
141142
142-
A Linepart namedtuple contains a start, stop, and word. None is returned
143-
if no target for this type of completion is found under the cursor."""
143+
A Linepart namedtuple contains a start, stop, and word. None is
144+
returned if no target for this type of completion is found under
145+
the cursor."""
144146
raise NotImplementedError
145147

146148
def format(self, word):
@@ -240,7 +242,7 @@ def locate(self, current_offset, line):
240242
def format(self, filename):
241243
filename.rstrip(os.sep).rsplit(os.sep)[-1]
242244
if os.sep in filename[:-1]:
243-
return filename[filename.rindex(os.sep, 0, -1)+1:]
245+
return filename[filename.rindex(os.sep, 0, -1) + 1:]
244246
else:
245247
return filename
246248

@@ -474,12 +476,10 @@ def matches(self, cursor_offset, line, **kwargs):
474476
except EvaluationError:
475477
return set()
476478
with inspection.AttrCleaner(obj):
477-
# strips leading dot
479+
# strips leading dot
478480
matches = [m[1:] for m in self.attr_lookup(obj, '', attr.word)]
479481

480-
481482
return set(m for m in matches if few_enough_underscores(attr.word, m))
482-
return matches
483483

484484

485485
try:
@@ -517,7 +517,7 @@ def matches(self, cursor_offset, line, **kwargs):
517517
self._orig_start = None
518518
return None
519519

520-
first_letter = line[self._orig_start:self._orig_start+1]
520+
first_letter = line[self._orig_start:self._orig_start + 1]
521521

522522
matches = [c.name for c in completions]
523523
if any(not m.lower().startswith(matches[0][0].lower())

0 commit comments

Comments
 (0)