python return true if not none