Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_weakref.py @ 40809:f340cb045bf9
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views.
The dict views aren't fully functional yet; in particular, they can't
be compared to sets yet. but they are useful as "iterator wells".
There are still 27 failing unit tests; I expect that many of these
have fairly trivial fixes, but there are so many, I could use help.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 11 Feb 2007 06:12:03 +0000 |
| parents | 22760d53d4da |
| children | a84460e53160 |
line wrap: on
line diff
--- a/Lib/test/test_weakref.py Sat Feb 10 22:53:17 2007 +0000 +++ b/Lib/test/test_weakref.py Sun Feb 11 06:12:03 2007 +0000 @@ -839,7 +839,7 @@ def check_iters(self, dict): # item iterator: items = dict.items() - for item in dict.iteritems(): + for item in dict.items(): items.remove(item) self.assert_(len(items) == 0, "iteritems() did not touch all items") @@ -851,13 +851,13 @@ # key iterator, via iterkeys(): keys = dict.keys() - for k in dict.iterkeys(): + for k in dict.keys(): keys.remove(k) self.assert_(len(keys) == 0, "iterkeys() did not touch all keys") # value iterator: values = dict.values() - for v in dict.itervalues(): + for v in dict.values(): values.remove(v) self.assert_(len(values) == 0, "itervalues() did not touch all values") @@ -1093,7 +1093,7 @@ ... def __init__(self, ob, callback=None, **annotations): ... super(ExtendedRef, self).__init__(ob, callback) ... self.__counter = 0 -... for k, v in annotations.iteritems(): +... for k, v in annotations.items(): ... setattr(self, k, v) ... def __call__(self): ... '''Return a pair containing the referent and the number of @@ -1104,7 +1104,7 @@ ... self.__counter += 1 ... ob = (ob, self.__counter) ... return ob -... +... >>> class A: # not in docs from here, just testing the ExtendedRef ... pass ...
