diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-21 19:24:53 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-21 19:24:53 (GMT) |
commit | 31ce5cb989da7a8362b7ea232fc263f0fb738a75 (patch) | |
tree | 676b71d92894661253c5ddf87fd785bbf6d146eb /Lib/UserDict.py | |
parent | 8982cf5484e0203bc4505cdf13a5f797f477327a (diff) | |
download | cpython-31ce5cb989da7a8362b7ea232fc263f0fb738a75.zip cpython-31ce5cb989da7a8362b7ea232fc263f0fb738a75.tar.gz cpython-31ce5cb989da7a8362b7ea232fc263f0fb738a75.tar.bz2 |
Update more instances of has_key().
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): |