Skip to content

Commit dff7ef7

Browse files
authored
Update SortedDict example (grantjenks#179)
The new example makes it clear that sort is due to the key and not the value.
1 parent a1f52d6 commit dff7ef7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ In Python, we can do better. And we can do it in pure-Python!
2424
>>> sl[-3:]
2525
['e', 'e', 'e']
2626
>>> from sortedcontainers import SortedDict
27-
>>> sd = SortedDict({'c': 3, 'a': 1, 'b': 2})
27+
>>> sd = SortedDict({'c': -3, 'a': 1, 'b': 2})
2828
>>> sd
29-
SortedDict({'a': 1, 'b': 2, 'c': 3})
29+
SortedDict({'a': 1, 'b': 2, 'c': -3})
3030
>>> sd.popitem(index=-1)
31-
('c', 3)
31+
('c', -3)
3232
>>> from sortedcontainers import SortedSet
3333
>>> ss = SortedSet('abracadabra')
3434
>>> ss

0 commit comments

Comments
 (0)