mirror of
https://github.com/python/cpython.git
synced 2025-09-15 21:26:04 +00:00
Update more instances of has_key().
This commit is contained in:
parent
8982cf5484
commit
31ce5cb989
2 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue