aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-02-02 21:59:53 +0100
committerIlya Etingof <etingof@gmail.com>2017-02-02 21:59:53 +0100
commitceb6aaf9e575bb75f7b906f680d6ee622114e029 (patch)
tree989d6befb9e6c1a1003b7a72a0f4b00019659f0e /README.md
parente4d065825fd0e6ae489bc1f913f8f03251a4011f (diff)
downloadpyasn1-ceb6aaf9e575bb75f7b906f680d6ee622114e029.tar.gz
note dict protocol in example
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index b59b61c..5674892 100644
--- a/README.md
+++ b/README.md
@@ -114,15 +114,15 @@ introspect, modify, encode and send back.
```python
>>> received_record, rest_of_substrate = decode(substrate, asn1Spec=Record())
>>>
->>> print(received_record.prettyPrint())
-Record:
- id=123
- room=321
- house=0
+>>> for field in received_record:
+>>> print('{} is {}'.format(field, received_record[field]))
+id is 123
+room is 321
+house is 0
>>>
>>> record == received_record
True
->>> received_record['room'] = 123
+>>> received_record.update(room=123)
>>> substrate = encode(received_record)
>>> hexdump(substrate)
00000: 30 06 02 01 7B 80 01 7B