[issue14288] Make iterators pickleable

Antoine Pitrou report at bugs.python.org
Tue Mar 27 17:10:07 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

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

I think type consistency is important if it can be achieved reasonably
simply.
In the dict and set case, I'm not sure you can recreate the internal
table in the same order (even accross interpreter restarts). In this
case, you should just check that the unpickled data is a subclass of
collections.abc.Iterator.

----------

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


More information about the Python-bugs-list mailing list