How To Check If An Object Is Nonetype In Python