- 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.
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 @@
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
...