diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index 3b6992ed..cf9293ea 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -320,9 +320,7 @@ class Evaluator(object): elif typ == 'eval_input': types = self._eval_element_not_cached(context, element.children[0]) elif typ == 'annassign': - print(element.children[1]) types = pep0484._evaluate_for_annotation(context, element.children[1]) - print('xxx') else: types = precedence.calculate_children(self, context, element.children) debug.dbg('eval_element result %s', types) diff --git a/jedi/evaluate/analysis.py b/jedi/evaluate/analysis.py index 46a4145d..29cf614b 100644 --- a/jedi/evaluate/analysis.py +++ b/jedi/evaluate/analysis.py @@ -82,7 +82,6 @@ def add(node_context, error_name, node, message=None, typ=Error, payload=None): # TODO this path is probably not right module_context = node_context.get_root_context() - print(module_context, node) module_path = module_context.py__file__() instance = typ(error_name, module_path, node.start_pos, message) debug.warning(str(instance), format=False) diff --git a/jedi/evaluate/filters.py b/jedi/evaluate/filters.py index 7bb2c872..c0b6e592 100644 --- a/jedi/evaluate/filters.py +++ b/jedi/evaluate/filters.py @@ -284,7 +284,7 @@ def get_global_filters(evaluator, context, until_position, origin_scope): First we get the names names from the function scope. >>> no_unicode_pprint(filters[0]) - >> + > >>> sorted(str(n) for n in filters[0].values()) ['', ''] >>> filters[0]._until_position diff --git a/jedi/parser/python/tree.py b/jedi/parser/python/tree.py index 77fe53f1..91c5c165 100644 --- a/jedi/parser/python/tree.py +++ b/jedi/parser/python/tree.py @@ -12,13 +12,11 @@ the input given to the parser. This is important if you are using refactoring. The easiest way to play with this module is to use :class:`parsing.Parser`. :attr:`parsing.Parser.module` holds an instance of :class:`Module`: ->>> from jedi._compatibility import u ->>> from jedi.parser.python import load_grammar ->>> from jedi.parser import ParserWithRecovery ->>> parser = ParserWithRecovery(load_grammar(), u('import os'), 'example.py') +>>> from jedi.parser.python import parse +>>> parser = parse('import os') >>> module = parser.get_root_node() >>> module - + Any subclasses of :class:`Scope`, including :class:`Module` has an attribute :attr:`imports `: @@ -77,7 +75,7 @@ class DocstringMixin(object): @property def raw_doc(self): """ Returns a cleaned version of the docstring token. """ - if isinstance(self, Module): + if self.type == 'file_input': node = self.children[0] elif isinstance(self, ClassOrFunc): node = self.children[self.children.index(':') + 1] @@ -132,7 +130,7 @@ class PythonMixin(): if isinstance(scope, (PythonNode, PythonLeaf)) and parent.type != 'simple_stmt': if scope.type == 'testlist_comp': try: - if isinstance(scope.children[1], CompFor): + if scope.children[1].type == 'comp_for': return scope.children[1] except IndexError: pass