caluma
caluma copied to clipboard
Jexl: "in" operator for strings
Currently, "foo" in bar
with bar = null/None
evaluates to
-
false
in the frontend - throws
TypeError: argument of type 'NoneType' is not iterable
in the backend
The reason for this is stated in PyJEXL's README:
JavaScript-style implicit type conversions aren't supported, but may be added in the future. Instead, Python type semantics are used.
I guess that if we decide to tackle this, we should either try implementing JS type conversions in PyJEXL, or try monkey-patching in
.
In the meantime, a workaround is "foo in (bar || "")
.