[python] How to "test" NoneType in python?