Hello,
I have been using proto3 in Python. I have following message format
Filename: sample.proto
message myData {
map<string, uint64> data = 1;
}
Now lets say I generated the sample_pb2.py
when I do this
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
my_data = sample_pb2.myData()
my_data.data['hello'] = 10
print(b'hello' in my_data.data)
the output comes True.
When I checked, the cpp api, it has a typechecker.
But when I use
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'
and do the same as above. I get the output False.
Due to this, when my software was running on the nodes, where they have
python implementation of protobuf, it was resulting into an issue, while
was working fine for the cpp implementation.
So now, either the problem is with cpp implementation or with the python
implementation. Looking to the code, problem is in python implementation as
its not performing typechecking properly in python api.
I have created an issue regarding this at
https://github.com/google/protobuf/issues/4029
Also a PR for the issue at
https://github.com/google/protobuf/pull/4030
I am expecting a reply from protobuf team soon, since this is critical for
our development.
Regards,
Kaushal
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.