[issue11299] Allow deepcopying and pickling paused generators

2012-12-05 Thread Bruno Dupuis
Changes by Bruno Dupuis : -- nosy: +bruno.dupuis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11299] Allow deepcopying and pickling paused generators

2011-02-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Alexandre, Do the considerations against pickling apply to deep copying? It would seem that copying bytecode and pointer within a run should be ok. -- ___ Python tracker

[issue11299] Allow deepcopying and pickling paused generators

2011-02-26 Thread Ram Rachum
Ram Rachum added the comment: *"generator objects do not have names we can refer to"* How about referring to the generator function that created them and to all the arguments? Regarding instruction pointer, I really don't know the internals of how this works. Can we make some arrangement so

[issue11299] Allow deepcopying and pickling paused generators

2011-02-26 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: The value of the instruction pointer depends on the byte-code. So it's not portable either. But, the bigger issue is the fact generator objects do not have names we can refer to, unlike top-level functions and classes which pickle supports. Similarly,

[issue11299] Allow deepcopying and pickling paused generators

2011-02-26 Thread Ram Rachum
Ram Rachum added the comment: Hi Alexandre, I read your blog post, but I don't understand-- Why does bytecode need to be pickled in order to pickle live generators? I understand that the local variables need to be pickled, (and let's assume they're all pickleable,) and that a pointer to the

[issue11299] Allow deepcopying and pickling paused generators

2011-02-25 Thread Alexandre Vassalotti
Alexandre Vassalotti 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 ho

[issue11299] Allow deepcopying and pickling paused generators

2011-02-25 Thread Ram Rachum
Ram Rachum added the comment: Tests attached. -- Added file: http://bugs.python.org/file20898/test_live_generator.py ___ Python tracker ___ _

[issue11299] Allow deepcopying and pickling paused generators

2011-02-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Test cases always help when appropriate. A link to the Pypy code that does this might also help. Or perhaps ask them to submit a patch to this issue. -- nosy: +alexandre.vassalotti, pitrou, terry.reedy stage: -> test needed ___

[issue11299] Allow deepcopying and pickling paused generators

2011-02-23 Thread Ram Rachum
Ram Rachum added the comment: P.S. I'm willing to write a test-case if it will help. -- ___ Python tracker ___ ___ Python-bugs-list m

[issue11299] Allow deepcopying and pickling paused generators

2011-02-23 Thread Ram Rachum
New submission from Ram Rachum : Please allow to deepcopy and to pickle paused generators, including all their state. This is implemented in Pypy: Python 2.5.2 (335e875cb0fe, Dec 28 2010, 20:31:56) [PyPy 1.4.1] on win32 Type "copyright", "credits" or "license()" for mor