I see, thanks! 在2022年11月3日星期四 UTC-5 10:22:46<[email protected]> 写道:
> Yes, you are right. Serializing a message and parsing it back on the other > side will always work, but starting from 4.21.0, Python apps won't be able > to share messages directly without that step. > > On Wed, Nov 2, 2022 at 10:32 PM No AnyLove (NoAnyLove) <[email protected]> > wrote: > >> Protobuf Python has switched to upb as default backend since 21.0, >> according to the release notes >> <https://github.com/protocolbuffers/protobuf/releases/tag/v21.0>, which >> significantly improves the performance. But according to notes here >> <https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates>and >> >> here >> <https://developers.google.com/protocol-buffers/docs/reference/python-generated#sharing-messages>, >> >> it implies the upb backend causes break when it shares messages between >> Python and C++. >> >> I'm a little bit confused here, as it can refer to 2 different situations, >> >> A Python app uses C++ extension, which passes the protobuf message >> objects between each other via function/class calls >> A Python app and a C++ app transmit protobuf messages via >> socket/pipe/etc., i.e., it needs to serialize/deserialize the messages >> >> According to the following note >> <https://developers.google.com/protocol-buffers/docs/reference/python-generated#sharing-messages>and >> >> protobuf advertising it as language-neutral, I assume the break only >> happens in the 1st situation, but want to double check that I'm not making >> mistake here. >> >> > Prior to Python 4.21.0, Python apps could share messages with C++ using >> a native extension. >> >> Thanks. >> >> -- >> 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 view this discussion on the web visit >> https://groups.google.com/d/msgid/protobuf/7c32529f-ac86-4207-a9a1-2865cbf4661an%40googlegroups.com >> >> <https://groups.google.com/d/msgid/protobuf/7c32529f-ac86-4207-a9a1-2865cbf4661an%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/261b40a5-665a-4aa9-a56d-f3e091ebaaf9n%40googlegroups.com.
