diff options
Diffstat (limited to 'Lib/UserDict.py')
-rw-r--r-- | Lib/UserDict.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py index a786ae0..39f4d07 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -41,7 +41,7 @@ class UserDict: def iterkeys(self): return self.data.iterkeys() def itervalues(self): return self.data.itervalues() def values(self): return self.data.values() - def has_key(self, key): return self.data.has_key(key) + def has_key(self, key): return key in self.data def update(self, dict=None, **kwargs): if dict is None: pass @@ -59,7 +59,7 @@ class UserDict: return failobj return self[key] def setdefault(self, key, failobj=None): - if not self.has_key(key): + if key not in self: self[key] = failobj return self[key] def pop(self, key, *args): |