@@ -44,8 +44,9 @@ assume `person_obj` to be some protobuf message
44
44
```
45
45
print person_obj['name'] # print out the person_obj.name
46
46
person_obj['name'] = 'David' # set the attribute 'name' to 'David'
47
- person_obj.update({'name': 'David'}) # again set the attribute 'name' to 'David' but in batch mode
48
- print ('name' in person_obj) # print whether the 'name' attribute is set in person_obj
47
+ # again set the attribute 'name' to 'David' but in batch mode
48
+ person_obj.update({'name': 'David'})
49
+ print ('name' in person_obj) # print whether the 'name' attribute is set in person_obj
49
50
# the 'in' operator is better than the google implementation HasField function
50
51
# in the sense that it won't raise Exception even if the field is not defined
51
52
```
@@ -60,8 +61,8 @@ person_obj['phone'] = [{'number': '5678'}] # dict assignment
60
61
person_obj[' phone' ] = [{' number' : ' 4567' }, Person.PhoneNumber(number = " 1234" )] # mixed assignment
61
62
```
62
63
63
- - However, at present, the implementation for the list assignment feature is ugly, unsafe and inefficient.-
64
- You didn't see anything in the above line.
64
+ ~~ However, at present, the implementation for the list assignment feature is ugly, unsafe and inefficient.~~
65
+ * You didn't see anything in the above line.*
65
66
66
67
#### Text Method
67
68
@@ -77,7 +78,7 @@ You didn't see anything in the above line.
77
78
```
78
79
79
80
80
- #### More Examples
81
+ #### More Examples
81
82
82
83
If you're still interested in our project, we suggest you reading our unit-test code in
83
84
[ tests/] ( https://github.com/XericZephyr/prototext/tree/master/tests ) folder which is intensively
0 commit comments