Hi,
> But do we really need it to be that complex? Why not just use a> type with an optional member, instead of going through a union:> > { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
Yes, should do, we don't have to pass back the chardev type here.
thanks,
Gerd

Il 09/01/2013 18:37, Eric Blake ha scritto:
> It also raises the question of whether unions even work with raw types,> or whether you have to always go through a struct, in which case you> should have used the 'String' wrapper instead of 'str', looking like:> > { 'union': 'ChardevReturn', 'data': { 'pty' : 'String',> 'nodata' : 'ChardevDummy' } }> ...> <- { "return": { "type" : "pty", "data" : { "str" : "/dev/pty0" } } }
They do work with raw types.
If it is conceivable to add more data in the future, however, it's
better to use the wrapped types.
Paolo