Message279471
Note: This class doesn't actually work on 3.4 in other ways (because __getitem__ is not idempotent, while OrderedDict assumes it is):
>>> s = SimpleLRUCache(2)
>>> s['t1'] = 1
>>> s
SimpleLRUCache([('t1', 1)])
>>> s['t2'] = 2
>>> s
SimpleLRUCache([('t1', 1)])
>>> s
SimpleLRUCache([('t2', 2)]) # <-- No changes, repr different
If your __getitem__ isn't idempotent, you've broken a basic assumption built into the logic of the other methods you inherited, and you're going to need to override other methods to avoid misbehavior. |
|
Date |
User |
Action |
Args |
2016-10-26 00:40:20 | josh.r | set | recipients:
+ josh.r, eric.snow, zach.ware, xiang.zhang |
2016-10-26 00:40:20 | josh.r | set | messageid: <1477442420.89.0.452014930973.issue28014@psf.upfronthosting.co.za> |
2016-10-26 00:40:20 | josh.r | link | issue28014 messages |
2016-10-26 00:40:20 | josh.r | create | |
|