custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
874 stars 46 forks source link

assignment operator yields wrong value #438

Closed Kaptensanders closed 1 year ago

Kaptensanders commented 1 year ago

Hi, first of all, thanks for pypscript, it's just awsome.

When doing this:

a = None or "foo" 

a is incorrectly assigned the value None

however, when used in a function decorated with @pyscript_compile, the expression yields the expected behavior a="foo"

Pyscript: 1.3.3 Home Assistant Core installation: 2023.2.2 Python 3.10.9

Br Anders

craigbarratt commented 1 year ago

Yikes - thanks for reporting. I've pushed fix f77d859 and test cases 48b6a8f.