rewrite 'if var is None' to 'if not var'