Skip to content

Commit

Permalink
Add document for MergeFromText
Browse files Browse the repository at this point in the history
  • Loading branch information
XericZephyr committed Oct 6, 2015
1 parent c0876c2 commit 0f3a84f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ person_obj['phone'] = [{'number': '4567'}, Person.PhoneNumber(number="1234")] #
We append a pair of text-format method to the protobuf objects, which are
```python
adr_book_obj = AddressBook()
adr_book_obj.ParseFromText(adr_book_text) # parse text format protobuf from adr_book_text
print adr_book_obj.SerializeToText() # print out the text format protobuf
adr_book_obj.MergeFromText(adr_book_text) # merge text format protobuf to adr_book_text
adr_book_obj.ParseFromText(adr_book_text)
# clear the content of adr_book_obj first and then merge from the text format protobuf
print adr_book_obj.SerializeToText() # print out the text format protobuf from object
```


Expand Down

0 comments on commit 0f3a84f

Please # to comment.