message items {
message require {
optional bool require_sex = 1; //
repeated int32 fate = 2 [packed = true];
}
optional int32 sub_type = 1;
repeated int32 levels = 2 [packed = true];
}
I tried
raw.require.require_sex = 1
raw.require.fate.append(1)
raw.require.fate.extend([2,3])
got an error AttributeError: 'property' object has no attribute 'append'
but the first level repeated field works fine:
raw = down_pb2.items()
raw.levels.append(4)
is this kind of definition not supported?
You need to create a field using that require type and then access that field in the code.
message items {
message require {
optional bool require_sex = 1; //
repeated int32 fate = 2 [packed = true];
}
optional int32 sub_type = 1;
repeated int32 levels = 2 [packed = true];
required require sub = 3;
}
then
raw.sub.fate.append(1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With