https://github.com/ros2/rosidl_runtime_py/blob/e6c860fec22ffc44556d6d87f730e2d07a8cc62b/rosidl_runtime_py/set_message.py#L99 instead, make a list before entering the loop, get all the values and place them in the list, and then use the list to assign the message