python if variable is not nonetype