Skip to content

Commit bf09b5e

Browse files
committed
Use n and iteritems
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent adfb053 commit bf09b5e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bpython/autocomplete.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import os
2828
import rlcompleter
2929
from six.moves import range, builtins
30-
from six import string_types
30+
from six import string_types, iteritems
3131

3232
from glob import glob
3333

@@ -292,10 +292,9 @@ def matches(self, cursor_offset, line, **kwargs):
292292
for word in KEYWORDS:
293293
if method_match(word, n, text):
294294
matches.add(word)
295-
for nspace in [builtins.__dict__, locals_]:
296-
for word, val in nspace.items():
297-
if (method_match(word, len(text), text) and
298-
word != "__builtins__"):
295+
for nspace in (builtins.__dict__, locals_):
296+
for word, val in iteritems(nspace):
297+
if method_match(word, n, text) and word != "__builtins__":
299298
word = try_decode(word, 'ascii')
300299
# if identifier isn't ascii, don't complete (syntax error)
301300
if word is None:

0 commit comments

Comments
 (0)