python check if value is not nonetype