Why do those two evaluate differently?
In [34]: a = ''
In [35]: if a or a >=0:
print 'y'
....:
y
In [36]: a = None
In [37]: if a or a >=0:
print 'y'
....:
I thought an empty string also evaluates to None (I know they are not the same)? Or is it just falsy and thus evaluates to 0 (which then evaluates to None if tested like if a: do something)?
ybecause of the>= 0part.if apart doesn't kick in because, as you say, an empty string andNoneis not the same thing.