- 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/Modules/cPickle.c b/Modules/cPickle.c
index 98ab500..ad2b91f 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -1752,7 +1752,7 @@
int res = -1;
char s[3];
int len;
- PyObject *iter;
+ PyObject *items, *iter;
if (self->fast && !fast_save_enter(self, args))
goto finally;
@@ -1784,7 +1784,11 @@
goto finally;
/* Materialize the dict items. */
- iter = PyObject_CallMethod(args, "iteritems", "()");
+ items = PyObject_CallMethod(args, "items", "()");
+ if (items == NULL)
+ goto finally;
+ iter = PyObject_GetIter(items);
+ Py_DECREF(items);
if (iter == NULL)
goto finally;
res = batch_dict(self, iter);