mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Implemented x if foo else y case.
This commit is contained in:
@@ -189,6 +189,10 @@ class Evaluator(object):
|
||||
for operator in element.children[:-1]:
|
||||
types = list(precedence.factor_calculate(self, types, operator))
|
||||
return types
|
||||
elif pr.is_node(element, 'test'):
|
||||
# `x if foo else y` case.
|
||||
return (self.eval_element(element.children[0]) +
|
||||
self.eval_element(element.children[-1]))
|
||||
else:
|
||||
return precedence.calculate_children(self, element.children)
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ def check_flow_information(evaluator, flow, search_name_part, pos):
|
||||
return None
|
||||
|
||||
result = []
|
||||
if flow.is_scope():
|
||||
if False and flow.is_scope():
|
||||
for ass in reversed(flow.asserts):
|
||||
if pos is None or ass.start_pos > pos:
|
||||
continue
|
||||
|
||||
@@ -136,7 +136,7 @@ a[0]
|
||||
|
||||
arr = [1,'']
|
||||
a = [a for a in arr]
|
||||
#? int()
|
||||
#? int() str()
|
||||
a[0]
|
||||
|
||||
a = [a if 1.0 else '' for a in [1] if [1.0]]
|
||||
|
||||
Reference in New Issue
Block a user