[EMAIL PROTECTED] (Alex Martelli) writes: > Now, x=ReentrantIterator(itertools.count()) should have all the > properties we want, I think. The locking is thanks of Queue.Queue and > its sweet implementation of the Template Method design pattern.
That is very cool, and generally useful enough that maybe it should be dropped into itertools. I see that Queue.get's implementation is quite intricate (it uses three separate locks to handle some additional cases like timeouts and non-blocking gets) but I'm not up to trying to grok it right now. Thanks! -- http://mail.python.org/mailman/listinfo/python-list