Python Check If Object Is Nonetype In Python