python check if object is not nonetype