Message156749
> ... and that pickling things like dict iterators entail running the
> iterator to completion and storing all of the results in a list.
The thing to emphasise here is that pickling an iterator is "destructive": afterwards the original iterator will be "empty".
I can't think of any other examples where pickling an object causes non-trivial mutation of that object.
Come to think of it, doesn't copy.copy() delegate to __reduce__()/__reduce_ex__(). It would be a bit surprising if copy.copy(myiterator) were to consume myiterator. I expect copy.copy() to return an independent copy without mutating the original object. |
|
Date |
User |
Action |
Args |
2012-03-25 11:40:24 | sbt | set | recipients:
+ sbt, loewis, georg.brandl, rhettinger, jcea, pitrou, kristjan.jonsson, michael.foord |
2012-03-25 11:40:24 | sbt | set | messageid: <1332675624.63.0.519361736684.issue14288@psf.upfronthosting.co.za> |
2012-03-25 11:40:22 | sbt | link | issue14288 messages |
2012-03-25 11:40:22 | sbt | create | |
|