Python Check If Object Is Nonetype