check if not none in python