I am looking at some code which apparently runs, as nobody has complained about it, but am well confused by what they have written:
if a and b is not None:
# do something
I have always thought of the 'and' operator as something which returns True or False, now am starting to doubt myself.. What else would it return, a number.. It is probably not pythonic, but am I missing something - how can someone write something like that?