antocuni / capnpy

Other
45 stars 26 forks source link

Add @Py.group annotation #25

Closed colinfang closed 6 years ago

colinfang commented 6 years ago
struct A {
    s @0 :Int64;
    x @1 :Int64;
    y @2 :Int64;
    z @3 :Text;
    xyz @4: Void $Py.group("x, y, z");
}

So that A.xyz would be the same as C.xyz in terms of decoding

struct C {
    s @0 :Int64;
    xyz :group $Py.key("x, y, z") {
        x @1 :Int64;
        y @2 :Int64;
        z @3 :Text;
    }
}