mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 15:24:46 +08:00
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:
@@ -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
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user