I found a particular bug in a piece of a function of mine, where the order of the args for the bitwise comparison OR seems to matter:
In: None or False
Out: False
In: False or None
Out: None
Checked this using Python 2.7.2 and IPython 0.10.2.
I can ensure that, in case of one element being None, making sure he's the first arg of the comparison, like this
if a==None:
a or b
else:
b or a
But could anyone please explain me why changing the order in an OR comparison would affect the output? Is this particular to Python?
Thanks.