What's The Difference?

Hi,

What’s the difference, if any, between these 2 constructs?

when: varname is none

…and…

when: varname | trim == ‘’

Are they equivalent, or is there a subtle difference?

-T

they are actually quite different.

None is a 'null' while '' is an empty string, different types. They
both evaluate to False so they would be equivalent here:

when: varname

but not in the specific tests you show, if varname is None, it would
error out in the 2nd test and the empty string would not match in the
first case.

Thanks, Brian!

So, “when: varname” is equivalent to both of my examples?

-T

not exactly, it will be false for the values of None and '' but not for ' '