Any is a special type that contains a string type_url field and a bytes value field. However, you normally shouldn't touch those fields directly, but instead you should use Pack, Unpack and Is methods for your Any type. Those fields represent how the data is transferred over the wire, but not necessarily something that you would want to access as part of the API.
On Tuesday, June 18, 2019 at 8:02:42 PM UTC-7, Shio Tse wrote: > > The only mention in the "Python Generated Code" page for the Any message > type is here > <https://developers.google.com/protocol-buffers/docs/reference/python-generated#any>. > > It goes through the basic usage and showcases exactly one use of the Pack, > Unpack and Is methods. > > However, I see no mention of the type_url and name fields unless I go > into the descriptor of the message in the REPL or I inspect the descriptor. > The epydoc index > <https://developers.google.com/protocol-buffers/docs/reference/python/identifier-index> > > does not contain any (heh) mention for Any either. > > However, when I tried to search for the message type on Google, I found > that the class was documented clearly for at least C# > <https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/any> > > and Java > <https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Any> > . > > Is there simply an oversight in not including google.protobuf.any_pb2 > into the documentation? > > Shio > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/d3701f12-bb31-4139-9511-93036dcd717c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
