Skip to content

Commit 9f14005

Browse files
authored
Fix outdated note on return type of SerializeToString
The correct return type of this functions is not `str` at all;¹ it appears that this documentation was not updated when the implementation moved from Python 2 to 3. ¹ https://github.com/python/typeshed/blob/1a9eef437a11c77817266961869ca66c49a14ac2/stubs/protobuf/google/protobuf/message.pyi#L26
1 parent 13bf22c commit 9f14005

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

content/getting-started/pythontutorial.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ of your chosen type using the protocol buffer
314314
include:
315315
316316
- `SerializeToString()`: serializes the message and returns it as a string.
317-
Note that the bytes are binary, not text; we only use the `str` type as a
318-
convenient container.
317+
Note that the return value is `bytes` (binary), not `str` (text).
319318
- `ParseFromString(data)`: parses a message from the given string.
320319
321320
These are just a couple of the options provided for parsing and serialization.

0 commit comments

Comments
 (0)