Tim Peters <t...@python.org> added the comment:
The docs could be clearer about this: the argument to .put() is _not_ pickled
at the time .put() is called. The object is remembered (by reference, not by
value), and a feeder thread pickles the value and puts the pickle on the queue
when the feeder thread gets around to that. So if the object is mutated in any
way in between, it's not defined whether the pre- or post-mutation state is put
on the queue (or, in some cases, even some partially mutated value).
To make it wholly deterministic you could, e.g., change the .put() to this:
Or you could use a Manager().Queue() instead, which doesn't use a feeder thread.
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list