mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Implemented the in operator in a very simple fashion: It returns nothing.
This commit is contained in:
@@ -157,6 +157,8 @@ def _element_calculate(evaluator, left, operator, right):
|
||||
except TypeError:
|
||||
# Could be True or False.
|
||||
return [true_obj, false_obj]
|
||||
elif operator == 'in':
|
||||
return []
|
||||
|
||||
def check(obj):
|
||||
"""Checks if a Jedi object is either a float or an int."""
|
||||
|
||||
@@ -400,6 +400,7 @@ class Simple(Base):
|
||||
def get_code(self):
|
||||
return "".join(c.get_code() for c in self.children)
|
||||
|
||||
@Python3Method
|
||||
def name_for_position(self, position):
|
||||
for c in self.children:
|
||||
if isinstance(c, Leaf):
|
||||
|
||||
@@ -68,6 +68,19 @@ i += 1
|
||||
#? int()
|
||||
x[i]
|
||||
|
||||
# -----------------
|
||||
# in
|
||||
# -----------------
|
||||
|
||||
if 'X' in 'Y':
|
||||
a = 3
|
||||
else:
|
||||
a = ''
|
||||
# For now don't really check for truth values. So in should return both
|
||||
# results.
|
||||
#? str() int()
|
||||
a
|
||||
|
||||
# -----------------
|
||||
# for flow assignments
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user