Remove dict.has_key() usage in the shelve module to silence warnings under -3.

This commit is contained in:
Brett Cannon 2008-08-04 21:17:15 +00:00
parent 5b3d3729ba
commit 753ecb13db
1 changed files with 3 additions and 3 deletions

View File

@ -105,13 +105,13 @@ class Shelf(UserDict.DictMixin):
return len(self.dict)
def has_key(self, key):
return self.dict.has_key(key)
return key in self.dict
def __contains__(self, key):
return self.dict.has_key(key)
return key in self.dict
def get(self, key, default=None):
if self.dict.has_key(key):
if key in self.dict:
return self[key]
return default