Sergey Fedoseev <[email protected]> added the comment:
Other iterators either don't support pickling or aren't mutated during pickling:
In [10]: it = iter({1})
In [11]: pickle.dumps(it)
Out[11]:
b'\x80\x04\x95\x1e\x00\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x04iter\x94\x93\x94]\x94K\x01a\x85\x94R\x94.'
In [12]: list(it)
Out[12]: [1]
In [13]: it = (x for x in {1})
In [14]: pickle.dumps(it)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-14-7e86a183a31c> in <module>()
----> 1 pickle.dumps(it)
TypeError: can't pickle generator objects
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34574>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com