Author rhettinger
Recipients georg.brandl, jcea, kristjan.jonsson, loewis, michael.foord, rhettinger
Date 2012-03-14.15:44:38
SpamBayes Score 1.98338e-10
Marked as misclassified No
Message-id <>
The dict iterators depend on the order of the dict being the same when unpickled on another python (the order will vary depending on dummy entries, insertion order, 32 vs 64 bit builds, salted hashes, etc).  Sets have the same issue -- it doesn't seem possible to pickle a set iterator in a "semi-consumed state" without being able to reproduce the underlying unordered collection in *exactly* the same order and being able to point the resumed iterators to the correct part of memory.  Any hacks to make this appear to work would like be hard to reproduce across different implementations of Python (i.e. Jython's dicts are based on Java's concurrent mappings).

There isn't a provision for saving and restoring running generators.

There isn't a provision for iterators created using iter(func, sentinel) where successive func calls change state.

I don't see how str iterators remember where they left off.

Note, the prior effort to make iterators copyable was a failure.  It was difficult to do in the general case and the cases we did provide had zero uptake (i.e. they were never used).  ISTM, that pickling iterators faces the same issues.
Date User Action Args
2012-03-14 16:17:10rhettingerunlinkissue14288 messages
2012-03-14 15:44:39rhettingersetrecipients: + rhettinger, loewis, georg.brandl, jcea, kristjan.jonsson, michael.foord
2012-03-14 15:44:39rhettingersetmessageid: <>
2012-03-14 15:44:39rhettingerlinkissue14288 messages
2012-03-14 15:44:38rhettingercreate