I think this behaves right To attain the behaviour you desire you just need to omit default values and in your own code you can ask if None assign value
On Wed, Nov 20, 2013 at 6:47 PM, James Haggerty <[email protected]> wrote: > Hey all, > > Consider a struct like: > > struct Dummy { > 1: optional i32 id; > 2: optional i32 age = 10; > } > > So, at least with the Python libs, what appear to happen with default > values using TBinaryProtocol is: > > - if I construct Dummy(), it serialises age (as 10) > - if I construct Dummy(age=None), it doesn't serialise age, but age is set > to 10 when it deserialises > > In the interests of reducing the amount of stuff serialised, could this be > changed so that default values are not serialised (i.e. Dummy() is > equivalent to Dummy(age=None)?). The only possible disadvantage is that it > means you get the receiver's default rather than the sender's default if > there's a mismatch - but it's unclear what the desired behaviour would be > in this case anyway. > > Thanks, > James. >
