Josh Rosenberg added the comment:
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.
----------
nosy: +josh.r
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com