diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-01 14:25:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-01 14:25:41 (GMT) |
commit | 793d4b49361a010e4baa485ec77e3adc430f0236 (patch) | |
tree | ac896a08f9b8e5cc980472c86a1644e59c5c73e1 /Lib/dumbdbm.py | |
parent | 54f0222547b1e92cd018ef132307a6f793dc9505 (diff) | |
download | cpython-793d4b49361a010e4baa485ec77e3adc430f0236.zip cpython-793d4b49361a010e4baa485ec77e3adc430f0236.tar.gz cpython-793d4b49361a010e4baa485ec77e3adc430f0236.tar.bz2 |
SF 563203. Replaced 'has_key()' with 'in'.
Diffstat (limited to 'Lib/dumbdbm.py')
-rw-r--r-- | Lib/dumbdbm.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py index c2b7952..b6b7fc3 100644 --- a/Lib/dumbdbm.py +++ b/Lib/dumbdbm.py @@ -108,7 +108,7 @@ class _Database: def __setitem__(self, key, val): if not type(key) == type('') == type(val): raise TypeError, "keys and values must be strings" - if not self._index.has_key(key): + if not key in self._index: (pos, siz) = self._addval(val) self._addkey(key, (pos, siz)) else: @@ -130,10 +130,10 @@ class _Database: return self._index.keys() def has_key(self, key): - return self._index.has_key(key) + return key in self._index def __contains__(self, key): - return self._index.has_key(key) + return key in self._index def iterkeys(self): return self._index.iterkeys() |