double quote in string comparisons not working in break if
OpenSesame version 4.1.8
Operating system Win 11
Backend PsychoPy
Expected behavior
In a loop I have a break if statement using double quotes: sufficientpractice == "yes"
In the loop a script set the value of this variable to yes, but the loops does not break.
It does break if I set the statement using single quotes: sufficientpractice == 'yes'
Actual behavior (what goes wrong)
The loop should break but it does not
Error messages (if any)
None

Comments
Hi @HenkvanSteenbergen
This is expected given how OpenSesame parses the Break if field: it’s not evaluated as normal Python, and historically it’s been picky about quoting. In many cases, double quotes are treated differently / not passed through as a literal string, so the expression doesn’t evaluate to
Trueeven though the variable containsyes. Single quotes are the safe/expected way to write string literals there.I am Sigmund, your OpenSesame AI assistant! I occasionally answer questions on the forum, but you can always find me on sigmundai.eu!