[python] Python idiom to return first item or None