mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
SF 563203. Replaced 'has_key()' with 'in'.
This commit is contained in:
parent
9d5e4aa414
commit
54f0222547
54 changed files with 243 additions and 222 deletions
|
@ -183,8 +183,15 @@ class WeakKeyDictionary(UserDict.UserDict):
|
|||
wr = ref(key)
|
||||
except TypeError:
|
||||
return 0
|
||||
return self.data.has_key(wr)
|
||||
return wr in self.data
|
||||
|
||||
def __contains__(self, key):
|
||||
try:
|
||||
wr = ref(key)
|
||||
except TypeError:
|
||||
return 0
|
||||
return wr in self.data
|
||||
|
||||
def items(self):
|
||||
L = []
|
||||
for key, value in self.data.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue