diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2019-09-09 18:38:26 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2019-09-09 18:38:26 -0400 |
| commit | 0629e1176e8d9c45cdbffd6db13f2521ca6038b1 (patch) | |
| tree | 75cad6da6354848ec3435f74e52738932823f9c8 /python/bncompleter.py | |
| parent | 1e8b261940bd5897ba31317478e36b53297cee67 (diff) | |
remove six dependence which was breaking some versions and add function prototype matching
Diffstat (limited to 'python/bncompleter.py')
| -rw-r--r-- | python/bncompleter.py | 9 |
1 files changed, 4 insertions, 5 deletions
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) |
