forked from VimPlug/jedi
Explicitly handle a not in b operator comparison
This avoids a `KeyError` from operator_to_magic_method lookup for this case. Jedi probably could check for `__contains__` here, however as it doesn't do so for `in` checks I'm following that lead for now. Fixes https://github.com/davidhalter/jedi/issues/1594.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user