From 0629e1176e8d9c45cdbffd6db13f2521ca6038b1 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Mon, 9 Sep 2019 18:38:26 -0400 Subject: remove six dependence which was breaking some versions and add function prototype matching --- python/bncompleter.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/bncompleter.py b/python/bncompleter.py index fabb7fc2..e1dfab1a 100644 --- a/python/bncompleter.py +++ b/python/bncompleter.py @@ -39,9 +39,8 @@ Notes: """ import atexit -from six.moves import builtins -from six import class_types import __main__ +import inspect __all__ = ["Completer"] @@ -100,8 +99,8 @@ class Completer: return None def _callable_postfix(self, val, word): - if callable(val) and not isinstance(val, class_types): - word = word + "(" + if callable(val) and not inspect.isclass(val): + word = word + str(inspect.signature(val)) return word def global_matches(self, text): @@ -125,7 +124,7 @@ class Completer: 'else'}: word = word + ' ' matches.append(word) - for nspace in [self.namespace, builtins.__dict__]: + for nspace in [self.namespace, __builtins__.__dict__]: for word, val in nspace.items(): if word[:n] == text and word not in seen: seen.add(word) -- cgit v1.3.1