Kaydet (Commit) fc3e61cd authored tarafından Barry Warsaw's avatar Barry Warsaw

UserDict.get(): New method to mirror built-in dictionaries' get()

method.
üst c38c5da5
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment