Update more instances of has_key().

This commit is contained in:
Raymond Hettinger 2008-02-21 19:24:53 +00:00
parent 8982cf5484
commit 31ce5cb989
2 changed files with 5 additions and 5 deletions

View file

@ -95,13 +95,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