I often play games with data bindings to get the result I expect. I ran into a situation today where I got the following error message:
SyntaxError: Syntax error in data binding for never_expires.checked
There was no syntax error in the data binding itself, the syntax error happened internally to Anvil when it tried to build whatever final expression it builds from the data binding.
The root cause was that I had left the default write-back box checked, but was setting the data binding to a constant. Obviously write-back doesn’t work in that situation, but I’d have hoped for an error message that made it more clear what I was doing wrong.
For the interested, I was doing this in the checked data binding for a checkbox:
False if self.item['expires'] else True
It works fine with write-back unchecked, but gives the ambiguous error message when write-back is checked.