How to assign to repeated field?

后端 未结 4 1020
猫巷女王i
猫巷女王i 2021-01-30 15:36

I am using protocol buffers in python and I have a Person message

repeated uint64 id

but when I try to assign a value to it like:<

4条回答
  •  有刺的猬
    2021-01-30 16:02

    For repeated composite types this is what worked for me.

    del person.things[:]
    person.things.extend([thing1, thing2, ..])
    

    taken from these comments How to assign to repeated field? How to assign to repeated field?

提交回复
热议问题