diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 9cc81a4..cffd086 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -675,19 +675,23 @@ class Completer(Configurable): matches = [] match_append = matches.append n = len(text) - for lst in [keyword.kwlist, - builtin_mod.__dict__.keys(), - list(self.namespace.keys()), - list(self.global_namespace.keys())]: + for lst in [ + keyword.kwlist, + builtin_mod.__dict__.keys(), + list(self.namespace.keys()), + list(self.global_namespace.keys()), + ]: for word in lst: if word[:n] == text and word != "__builtins__": match_append(word) snake_case_re = re.compile(r"[^_]+(_[^_]+)+?\Z") - for lst in [list(self.namespace.keys()), - list(self.global_namespace.keys())]: - shortened = {"_".join([sub[0] for sub in word.split('_')]) : word - for word in lst if snake_case_re.match(word)} + for lst in [list(self.namespace.keys()), list(self.global_namespace.keys())]: + shortened = { + "_".join([sub[0] for sub in word.split("_")]): word + for word in lst + if snake_case_re.match(word) + } for word in shortened.keys(): if word[:n] == text and word != "__builtins__": match_append(shortened[word])