This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients eric.snow, josh.r, xiang.zhang, zach.ware
Date 2016-10-26.00:40:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477442420.89.0.452014930973.issue28014@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-10-26 00:40:20josh.rsetrecipients: + josh.r, eric.snow, zach.ware, xiang.zhang
2016-10-26 00:40:20josh.rsetmessageid: <1477442420.89.0.452014930973.issue28014@psf.upfronthosting.co.za>
2016-10-26 00:40:20josh.rlinkissue28014 messages
2016-10-26 00:40:20josh.rcreate