Hi again,

On Wed, Nov 23, 2016 at 6:24 PM, Nathaniel Manista <nathan...@google.com>
wrote:

> possibly a oneof
> <https://developers.google.com/protocol-buffers/docs/proto#using-oneof> that
> can communicate exactly one of the id of a found book or the fact that the
> book was not found.


This makes sense to me, I'll give it a shot!


> resp = self.stub.BookGet(library_pb2.BookGetRequest(id='12345'))
>>
> resp is None          # False
>> resp.book is None     # False
>> resp.book.id is None  # False
>> resp.book.id == ''    # True
>>
>> So I could only make use of the last assertion but that seems far from
>> ideal, right?
>>
>
> I think this has to do with the changes in Protocol Buffers 3 and how
> fields and messages are never "not present" any more.
>

Ok, I'm glad to know that was conscious choice and not a bug in my code :)

Thank you so much,

-- 
Jesús García Crespo

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to