Remove dict.has_key() usage in the shelve module to silence warnings under -3.
This commit is contained in:
parent
5b3d3729ba
commit
753ecb13db
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue