From 381b999eda46996780f05513fb6313ae80eba4dc Mon Sep 17 00:00:00 2001 From: David Halter Date: Sun, 18 Nov 2012 22:09:27 +0100 Subject: [PATCH] extension for #61 --- jedi/api_classes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jedi/api_classes.py b/jedi/api_classes.py index 0708c1c0..3dbfbc2b 100644 --- a/jedi/api_classes.py +++ b/jedi/api_classes.py @@ -19,6 +19,10 @@ class BaseOutput(object): '_io': 'io' } + _tuple_mapping = { + ('argparse', '_ActionsContainer'): 'argparse._ActionsContainer' + } + def __init__(self, definition, start_pos): self.start_pos = start_pos self.definition = definition @@ -91,6 +95,10 @@ class BaseOutput(object): path[0] = self._mapping[path[0]] except KeyError: pass + for key, repl in self._tuple_mapping.items(): + if tuple(path[:len(key)]) == key: + path = [repl] + path[len(key)] + return '.'.join(path) def __repr__(self):