[issue14288] Make iterators pickleable

Kristján Valur Jónsson report at bugs.python.org
Tue Mar 27 16:29:09 CEST 2012


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

I've incorporated antoine's comments and the proposed internal function name into a new patch.

A lot of the changes concerned thecking the type() of the unpickled iterator.  Now, it wasn't a specific design goal to get the exact same objects back, only _equivalent_ objects.  In particular, dicts and sets have problems, so a dictiter to a partially consumed dict cannot be pickled as it is.

so, I've added type cases everywhere, but for those cases.
Now, how important do you think type consistency is?  when using iterators, does one ever look at it and test its type?  if this is important, I _could_ take another look at dicts and seta and create fresh iterators to the dicts and sets made out of the remainder of the items, rather than iterators to lists.

Any thoughs?

----------
Added file: http://bugs.python.org/file25042/pickling2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14288>
_______________________________________


More information about the Python-bugs-list mailing list