[issue11299] Allow deepcopying and pickling paused generators

Alexandre Vassalotti report at bugs.python.org
Fri Feb 25 23:02:09 CET 2011


Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Although, I would really like to see support of pickling generators. It is not really possible in CPython. This is recurrent request. I even wrote a small article about it.

http://peadrop.com/blog/2009/12/29/why-you-cannot-pickle-generators/

Looking how PyPy did it, I see portability problems with the fact it dumps the byte-code of the generator to disk. Python's documentation clearly states that the byte-code is an implementation details and can (and does) change between releases. Hence, this method is not really suitable for pickle which needs to remain compatible across releases.

----------

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


More information about the Python-bugs-list mailing list