[Python-ideas] `__iter__` for queues?

cool-RR cool-rr at cool-rr.com
Tue Jan 19 22:20:46 CET 2010


On Tue, Jan 19, 2010 at 11:10 PM, Simon Brunning
<simon at brunningonline.net>wrote:

> 2010/1/19 cool-RR <cool-rr at cool-rr.com>:
> > Is there a reason that queues don't have an `__iter__` method? I mean
> both
> > `Queue.Queue` and `multiprocessing.Queue`.
>
> Could it be made threadsafe?
>
> --
> Cheers,
> Simon B.
>

For me, iterating on the queue means just calling `get` repeatedly until
it's empty. Now that I think about it, maybe this is not the most obvious
meaning? I'm not sure now.

Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100119/3bda2b16/attachment.html>


More information about the Python-ideas mailing list