BUG: Expression evaluation issue

I’m designing a system where a parameter can bind to a deeply dependable dict via:

op.CONFIG.Get(“key”, default)

the Get() function will add the “key” to the deeply dependable dict if it does not exist and then return a dependency to that key. But I often end up with ghost entries in the dictionary, in this case it could be

{
“k”: “default”,
“ke”: default,
“key”: default,
}

It seems that if the mouse is moved a bit while editing an expression, then expression is evaluated at its current state, and in my case it will create those ghost keys

As a simplified example without binding see attached file: NewProject.1.toe (4.0 KB)

Edit the “typeHere” string in the geo1.par.Float expression and while typing move the mouse over the borders of the parameter. The textport will print the current string you are typing, which in my production case would incorrectly add new keys to my config dict.

Hope that makes sense.

So imho the bug is that expressions are evaluated while they are edited

1 Like

Hey @Achim

Thanks for the report and nice sample.

I’m able to reproduce.

I’m not sure offhand why the expression would evaluate while being edited, if there is a reason behind it… I will log this as an issue for a developer to look into it.

Best,
Michel

I suspect that this is for the sake of the tooltip, which evaluates the value. Probably shouldn’t happen while typing, but still I would say in general it is NOT SAFE to use expressions to perform actions of any type. An expression should return a value only.