diff options
author | Guido van Rossum <guido@python.org> | 2007-02-11 06:12:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-11 06:12:03 (GMT) |
commit | cc2b0161257495f859200bce0aea3ed7e646feb3 (patch) | |
tree | ba09aba0de6447bef5be59b43fb86d17d760833d /Lib/test/test_weakref.py | |
parent | 4e66dfcdc495218ad5f98b12ad6b4b2b05630ab0 (diff) | |
download | cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.zip cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.gz cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.bz2 |
- 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.
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r-- | Lib/test/test_weakref.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 76169f7..1213b57 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -839,7 +839,7 @@ class MappingTestCase(TestBase): 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 @@ class MappingTestCase(TestBase): # 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 @@ None ... 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 @@ None ... self.__counter += 1 ... ob = (ob, self.__counter) ... return ob -... +... >>> class A: # not in docs from here, just testing the ExtendedRef ... pass ... |