It is not a if clause, it is a normal expression. It works the same way in C++ so I'm used to it:

(a == b) is 1 when true, and 0 when false.

So my.flag = (a == b) sets the flag ON (1) when the condition is true and sets it OFF (0) otherwise.