Exemplo n.º 1
0
    def follow_definition(self):
        """ Returns you the original definitions. I strongly recommend not
        using it for your completions, because it might slow down Jedi. If you
        want to read only a few objects (<=20). I think it might be useful,
        especially to get the original docstrings.
        The basic problem of this function is that it follows all results. This
        means with 1000 completions (e.g. numpy), it's just PITA slow.
        """
        if self._followed_definitions is None:
            if self.definition.isinstance(parsing.Statement):
                defs = evaluate.follow_statement(self.definition)
            elif self.definition.isinstance(parsing.Import):
                defs = imports.strip_imports([self.definition])
            else:
                return [self]

            self._followed_definitions = \
                            [BaseDefinition(d, d.start_pos) for d in defs]
            evaluate.clear_caches()

        return self._followed_definitions
Exemplo n.º 2
0
    def follow_definition(self):
        """ Returns you the original definitions. I strongly recommend not
        using it for your completions, because it might slow down Jedi. If you
        want to read only a few objects (<=20). I think it might be useful,
        especially to get the original docstrings.
        The basic problem of this function is that it follows all results. This
        means with 1000 completions (e.g. numpy), it's just PITA slow.
        """
        if self._followed_definitions is None:
            if self.definition.isinstance(parsing.Statement):
                defs = evaluate.follow_statement(self.definition)
            elif self.definition.isinstance(parsing.Import):
                defs = imports.strip_imports([self.definition])
            else:
                return [self]

            self._followed_definitions = \
                            [BaseDefinition(d, d.start_pos) for d in defs]
            evaluate.clear_caches()

        return self._followed_definitions
Exemplo n.º 3
0
 def __del__(self):
     evaluate.clear_caches()
Exemplo n.º 4
0
 def __del__(self):
     evaluate.clear_caches()