Skip to content

Commit

Permalink
[core] Readd a couple missing operators
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Apr 10, 2023
1 parent 8ae44f8 commit dc4c430
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xpp/modules/simpleeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ class MultipleExpressions(UserWarning):
ast.BitXor: op.pow,
ast.BitOr: op.or_,
ast.BitAnd: op.and_,
ast.Invert: op.invert
ast.Invert: op.invert,
ast.Is: lambda a, b: isinstance(a, {"int": int, "str": str, "null": None, "float": float}[b]),
ast.In: lambda a, b: a in b,
ast.NotIn: lambda a, b: a not in b
}

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

0 comments on commit dc4c430

Please sign in to comment.