summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/UserDict.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py
index 2f4f541..3b9b157 100644
--- a/Lib/UserDict.py
+++ b/Lib/UserDict.py
@@ -26,3 +26,8 @@ class UserDict:
else:
for k, v in other.items():
self.data[k] = v
+ def get(self, key, failobj=None):
+ if self.data.has_key(key):
+ return self.data[key]
+ else:
+ return failobj