Why are "broken iterators" broken?

Fredrik Lundh fredrik at pythonware.com
Mon Sep 22 12:32:35 EDT 2008


Cameron Simpson wrote:

>> you probably want the consumer thread to block when it catches up with  
>> the producer, rather than exit.
>
> It sounds like he wants non-blocking behaviour in his consumer.

Roy gave an example, he didn't post a requirements specification.

> A common example is "try to gather a lot of stuff into a single packet,
> but send a smaller packet promptly if there isn't much stuff".

that use case is better solved with a plain list object.  no need to 
make things harder than they are.

</F>




More information about the Python-list mailing list