python check if value exists in list of objects