caluma icon indicating copy to clipboard operation
caluma copied to clipboard

Jexl: "in" operator for strings

Open czosel opened this issue 4 years ago • 0 comments

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 || "").

czosel avatar Nov 11 '20 07:11 czosel