Show More
@@ -651,7 +651,7 b' class lrucachedict(object):' | |||||
651 |
|
651 | |||
652 | def get(self, k, default=None): |
|
652 | def get(self, k, default=None): | |
653 | try: |
|
653 | try: | |
654 | return self._cache[k] |
|
654 | return self._cache[k].value | |
655 | except KeyError: |
|
655 | except KeyError: | |
656 | return default |
|
656 | return default | |
657 |
|
657 |
@@ -25,6 +25,9 b' def test_lrucachedict():' | |||||
25 | d['e'] = 've' |
|
25 | d['e'] = 've' | |
26 | printifpresent(d, ['a', 'b', 'c', 'd', 'e']) |
|
26 | printifpresent(d, ['a', 'b', 'c', 'd', 'e']) | |
27 |
|
27 | |||
|
28 | assert d.get('a') is None | |||
|
29 | assert d.get('e') == 've' | |||
|
30 | ||||
28 | # touch entries in some order (get or set). |
|
31 | # touch entries in some order (get or set). | |
29 | d['e'] |
|
32 | d['e'] | |
30 | d['c'] = 'vc2' |
|
33 | d['c'] = 'vc2' |
General Comments 0
You need to be logged in to leave comments.
Login now