1
0
forked from VimPlug/jedi

Remove a few print statements.

This commit is contained in:
Dave Halter
2017-04-01 12:43:57 +02:00
parent 1fd10d978d
commit 281d6a87a0
4 changed files with 6 additions and 11 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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])
<ParserTreeFilter: <ModuleContext: <Module: None@2-5>>>
<ParserTreeFilter: <ModuleContext: @2-5>>
>>> sorted(str(n) for n in filters[0].values())
['<TreeNameDefinition: func@(3, 4)>', '<TreeNameDefinition: x@(2, 0)>']
>>> filters[0]._until_position

View File

@@ -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
<Module: example.py@1-1>
<Module: @1-1>
Any subclasses of :class:`Scope`, including :class:`Module` has an attribute
:attr:`imports <Scope.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