comparison to None should be 'if cond is not None'