Re: [protobuf] protobuf messages as repeated field?

2017-07-20 Thread Mingjian Lu
For anyone who might reach here for the same question. I suggest using extend instead of add and then give values to fields. For example: packetMessage.checkMessage.balanceUpdates.extend([balanceUpdateMessage]) This is much simpler and also easy for assigning object after deserialization and

Re: [protobuf] protobuf messages as repeated field?

2013-06-24 Thread Ilia Mirkin
Try x = packetMessage.checkMessage.balanceUpdates.add() x.tid = 111 x.amount = 222 See https://developers.google.com/protocol-buffers/docs/pythontutorial for more info. On Sun, Jun 23, 2013 at 9:49 AM, Lotte R. Leben lo...@zombietetris.de wrote: Hi, this might be quite the newbie question,