forked from VimPlug/jedi
Fix a first test: complex.py
This commit is contained in:
@@ -131,7 +131,6 @@ class Evaluator(object):
|
||||
if isinstance(stmt, FakeStatement):
|
||||
return stmt.children # Already contains the results.
|
||||
|
||||
print('X', stmt.get_rhs())
|
||||
result = self.eval_element(stmt.get_rhs())
|
||||
|
||||
ass_details = stmt.assignment_details
|
||||
@@ -188,7 +187,7 @@ class Evaluator(object):
|
||||
return self.find_types(stmt.parent, atom, stmt.start_pos,
|
||||
search_global=True)
|
||||
elif isinstance(atom, pr.Literal):
|
||||
return [compiled.create(self, atom.value)]
|
||||
return [compiled.create(self, atom.eval())]
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@@ -233,7 +233,6 @@ class NameFinder(object):
|
||||
|
||||
for name in names:
|
||||
typ = name.get_definition()
|
||||
print(typ)
|
||||
if typ.isinstance(pr.ForFlow):
|
||||
types += self._handle_for_loops(typ)
|
||||
elif isinstance(typ, pr.Param):
|
||||
|
||||
@@ -250,7 +250,9 @@ def get_instance_el(evaluator, instance, var, is_class_var=False):
|
||||
# TODO temp solution, remove later, Name should never get
|
||||
# here?
|
||||
par = get_instance_el(evaluator, instance, var.parent, is_class_var)
|
||||
return pr.Name(var._sub_module, unicode(var), par, var.start_pos)
|
||||
name = pr.Name(unicode(var), var.start_pos)
|
||||
name.parent = par
|
||||
return name
|
||||
return var
|
||||
|
||||
var = wrap(evaluator, var)
|
||||
|
||||
@@ -409,7 +409,6 @@ class Scope(Simple, DocstringMixin):
|
||||
elements += scan(element.children)
|
||||
return elements
|
||||
|
||||
print('return', scan(self.children))
|
||||
return scan(self.children)
|
||||
|
||||
@property
|
||||
@@ -475,7 +474,10 @@ class Scope(Simple, DocstringMixin):
|
||||
[<Name: a@2,0>, <Name: b@3,0>, <Name: b.c@4,0>]
|
||||
"""
|
||||
names = []
|
||||
for c in self.children:
|
||||
children = self.children
|
||||
if is_node(children[-1], 'suite'):
|
||||
children = children[-1].children
|
||||
for c in children:
|
||||
if is_node(c, 'simple_stmt'):
|
||||
names += chain.from_iterable(
|
||||
[s.get_defined_names() for s in c.children
|
||||
|
||||
Reference in New Issue
Block a user