Skip to content

Commit dc4c430

Browse files
committed
[core] Readd a couple missing operators
1 parent 8ae44f8 commit dc4c430

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xpp/modules/simpleeval.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ class MultipleExpressions(UserWarning):
239239
ast.BitXor: op.pow,
240240
ast.BitOr: op.or_,
241241
ast.BitAnd: op.and_,
242-
ast.Invert: op.invert
242+
ast.Invert: op.invert,
243+
ast.Is: lambda a, b: isinstance(a, {"int": int, "str": str, "null": None, "float": float}[b]),
244+
ast.In: lambda a, b: a in b,
245+
ast.NotIn: lambda a, b: a not in b
243246
}
244247

245248
DEFAULT_NAMES = {"true": True, "false": False, "null": None}

0 commit comments

Comments
 (0)