When inferring comparison operators, return a definite type instead of NO_VALUES for the in/not in operator
This commit is contained in:
1 parent
82d1902f38
commit
4d09ac07e4
3 files changed
+12
-1
No files matched your search
@@ -645,7 +645,10 @@ def _infer_comparison_part(inference_state, context, left, operator, right):
|
||||
_bool_to_value(inference_state, False)
|
||||
])
|
||||
elif str_operator in ('in', 'not in'):
|
||||
return NO_VALUES
|
||||
return ValueSet([
|
||||
_bool_to_value(inference_state, True),
|
||||
_bool_to_value(inference_state, False)
|
||||
])
|
||||
|
||||
def check(obj):
|
||||
"""Checks if a Jedi object is either a float or an int."""
|
||||
|
||||
Reference in new issue
Block a user