summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlhutch <jlhutch@gmail.com>2017-07-19 19:26:11 -0500
committerGitHub <noreply@github.com>2017-07-19 19:26:11 -0500
commit66163a3b86afcda092b3c2a7544e1b2ccc080cae (patch)
tree77610b7d5d277820811efe42a15223f89d8bec7c
parent585f3e87f54b657136f10df250b9141b0d78a7c3 (diff)
parentc4bdd74b1e45ce2a14e6f26990c4cfc171609046 (diff)
downloadpylru-66163a3b86afcda092b3c2a7544e1b2ccc080cae.tar.gz
Merge pull request #22 from btimby/master
Add `update()` method to simulate `dict`.
-rw-r--r--pylru.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pylru.py b/pylru.py
index fd44f97..3f8d8ec 100644
--- a/pylru.py
+++ b/pylru.py
@@ -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):