python ternary operator if not none