Show More
@@ -1277,14 +1277,14 b' class sortdict(collections.OrderedDict):' | |||||
1277 |
|
1277 | |||
1278 | >>> d1 = sortdict([(b'a', 0), (b'b', 1)]) |
|
1278 | >>> d1 = sortdict([(b'a', 0), (b'b', 1)]) | |
1279 | >>> d2 = d1.copy() |
|
1279 | >>> d2 = d1.copy() | |
1280 | >>> d2 |
|
1280 | >>> list(d2.items()) | |
1281 |
|
|
1281 | [('a', 0), ('b', 1)] | |
1282 | >>> d2.update([(b'a', 2)]) |
|
1282 | >>> d2.update([(b'a', 2)]) | |
1283 | >>> list(d2.keys()) # should still be in last-set order |
|
1283 | >>> list(d2.keys()) # should still be in last-set order | |
1284 | ['b', 'a'] |
|
1284 | ['b', 'a'] | |
1285 | >>> d1.insert(1, b'a.5', 0.5) |
|
1285 | >>> d1.insert(1, b'a.5', 0.5) | |
1286 | >>> d1 |
|
1286 | >>> list(d1.items()) | |
1287 |
|
|
1287 | [('a', 0), ('a.5', 0.5), ('b', 1)] | |
1288 | """ |
|
1288 | """ | |
1289 |
|
1289 | |||
1290 | def __setitem__(self, key, value): |
|
1290 | def __setitem__(self, key, value): |
General Comments 0
You need to be logged in to leave comments.
Login now