Python Check If Value Is Nonetype