python check if false and not none