python - How to assign to repeated field? -
i using protocol buffers in python , have inside person
message
repeated uint64 id
but when try assign
person.id = [1, 32, 43432]
i error assigment not allowed repeated field "id" in protocol message object
how assign repeated field ?
as per documentation, aren't able directly assign repeated field. in case, can call extend
add of elements in list field.
person.id.extend([1, 32, 43432])
Comments
Post a Comment