Closed jsamr closed 3 weeks ago
Yes, map
doesn't work correctly in pyscript
because all functions in pyscript
are async (coroutines), and map
expects a regular function.
You should add a @pyscript_compile
before the definition of entity_is_on_expr()
, which should make it a regular function. See the docs.
Just realized this after reading the section you mentioned above; @pyscript_compile
did work; thanks!
Running this code with Python interpreter...
... shows the following in the console:
Which is what I would expect in pyscript. Unfortunately, I get a type error instead:
Pyscript version 1.6.1