diff options
author | jlhutch <jlhutch@gmail.com> | 2017-07-19 19:26:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 19:26:11 -0500 |
commit | 66163a3b86afcda092b3c2a7544e1b2ccc080cae (patch) | |
tree | 77610b7d5d277820811efe42a15223f89d8bec7c | |
parent | 585f3e87f54b657136f10df250b9141b0d78a7c3 (diff) | |
parent | c4bdd74b1e45ce2a14e6f26990c4cfc171609046 (diff) | |
download | pylru-66163a3b86afcda092b3c2a7544e1b2ccc080cae.tar.gz |
Merge pull request #22 from btimby/master
Add `update()` method to simulate `dict`.
-rw-r--r-- | pylru.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -158,6 +158,11 @@ class lrucache(object): # need to adjust the 'head' variable. self.head = node + def update(self, items): + + # Add multiple items to the cache. + for n, v in items.items(): + self[n] = v def __delitem__(self, key): |