Merge pull request #1595 from PeterJCLaw/operator-not-in

Explicitly handle `a not in b` operator comparison
This commit is contained in:
Dave Halter
2020-05-23 14:48:40 +02:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -641,7 +641,7 @@ def _infer_comparison_part(inference_state, context, left, operator, right):
_bool_to_value(inference_state, True),
_bool_to_value(inference_state, False)
])
elif str_operator == 'in':
elif str_operator in ('in', 'not in'):
return NO_VALUES
def check(obj):

View File

@@ -100,6 +100,15 @@ else:
#? str() int()
a
if 'X' not in 'Y':
b = 3
else:
b = ''
# For now don't really check for truth values. So in should return both
# results.
#? str() int()
b
# -----------------
# for flow assignments
# -----------------