MCPcopy Index your code
hub / github.com/danielgtaylor/python-betterproto / __bytes__

Method __bytes__

src/betterproto/__init__.py:1021–1027  ·  view source on GitHub ↗

Get the binary encoded Protobuf representation of this message instance.

(self)

Source from the content-addressed store, hash-verified

1019 stream.write(self._unknown_fields)
1020
1021 def __bytes__(self) -> bytes:
1022 """
1023 Get the binary encoded Protobuf representation of this message instance.
1024 """
1025 with BytesIO() as stream:
1026 self.dump(stream)
1027 return stream.getvalue()
1028
1029 def __len__(self) -> int:
1030 """

Callers

nothing calls this directly

Calls 1

dumpMethod · 0.95

Tested by

no test coverage detected