Open benedikt-bartscher opened 1 month ago
I don't understand the @test.setter
annotation here. Generally I'm hesitant to do something like this where the reference changes based on the context.
@picklelo it's a design pattern from python properties, take a look here: https://docs.python.org/3/library/functions.html#property
Btw, the code above currently fails with this error:
TypeError: No JSON serializer found for State Var 'test' of value <function State.test at 0x7bfe9d21dbc0> of type <class 'function'>.
It does not fail while interpreting @test.setter
. It is actually defined because ComputedVar
inherits it from property
.
We could at least ignore those setters or raise a better exception message.
With this example,
State.test
would be aBaseVar
orEventHandler
depending on where it is used