Generators/iterators persistence

Pawel Oleksik oleksik at galaxy.uci.agh.edu.pl
Fri May 23 08:39:34 EDT 2003


Tim Peters <tim.one at comcast.net> wrote:
> [Pawel Oleksik]
[...]
>> I'm going to do that. But I guess it will be another level of
>> complications and possibly will lead to (at least simply) bugs.

> The same would be true if the system tried to do it for you, of course.

Of course :)


> Sorry, there isn't, won't be in 2.3, and there are no plans in this
> direction.  The state of an iterator/generator can be arbitrarily complex,
> potentially involving a giant web of code objects and execution frames

I guess, it would ... But on the other hand, freezing of standard iterators 
(sequences, mappings) probably could be done. For more complicated structures 
I can wait ;)

> (neither of which can be pickled today), so there will never be a simple
> solution.  That's not to say I wouldn't like one too <wink>.

In general it will not be a simple solution, but in several special cases <I
hope> it could be done in efficient way. (There is an accent on _efficient_,
of course.)

sincerly yours (& waiting better news)
p.o.





More information about the Python-list mailing list