mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Nailed test_weakref.py. Pfew, messy!
This commit is contained in:
parent
9afbb4e364
commit
07f2436fa8
4 changed files with 42 additions and 39 deletions
|
@ -106,10 +106,10 @@ class WeakValueDictionary(UserDict.UserDict):
|
|||
yield wr.key, value
|
||||
|
||||
def iterkeys(self):
|
||||
return self.data.keys()
|
||||
return iter(self.data.keys())
|
||||
|
||||
def __iter__(self):
|
||||
return self.data.keys()
|
||||
return iter(self.data.keys())
|
||||
|
||||
def itervaluerefs(self):
|
||||
"""Return an iterator that yields the weak references to the values.
|
||||
|
@ -292,10 +292,10 @@ class WeakKeyDictionary(UserDict.UserDict):
|
|||
yield obj
|
||||
|
||||
def __iter__(self):
|
||||
return self.keys()
|
||||
return iter(self.keys())
|
||||
|
||||
def itervalues(self):
|
||||
return self.data.values()
|
||||
return iter(self.data.values())
|
||||
|
||||
def keyrefs(self):
|
||||
"""Return a list of weak references to the keys.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue