Roy Smith wrote:

There are plausible examples of collections which grow while you're iterating over them. I'm thinking specifically of a queue in a multi-threaded application. One thread pushes work onto the back of the queue while another pops from the front. The queue could certainly go empty at times. But, maybe a Python iterator is just the wrong way to model such behavior.

you probably want the consumer thread to block when it catches up with the producer, rather than exit.

(that's the default behaviour of Python's Queue object, btw)

</F>

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to