Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Paddy
> You could possibly make a case that before Queue.put blocks it should check > whether the program has more than just the one thread and if not it should > raise an RTFMException. Cute :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Steve Holden
brad wrote: > Marc 'BlackJack' Rintsch wrote: > >> Why did you put an upper bound to the queue? > > For clarity. Explicit is better than implicit, right? In our design, the > queue should only have x number of things, so why not show that? Other > than that, the limit is arbitrary and is not ne

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Duncan Booth
brad <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > >> ... the producer is designed to block if >> the queue is full. You can use the put_nowait method to have it raise >> an exception instead of blocking. > > I assumed that the behavior would have been the other way around. I > should not

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Bill Scherer
brad wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to do this instead of just hangin

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread brad
Marc 'BlackJack' Rintsch wrote: > Why did you put an upper bound to the queue? For clarity. Explicit is better than implicit, right? In our design, the queue should only have x number of things, so why not show that? Other than that, the limit is arbitrary and is not needed. -- http://mail.pyt

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread brad
Chris Mellon wrote: > ... the producer is designed to block if > the queue is full. You can use the put_nowait method to have it raise > an exception instead of blocking. I assumed that the behavior would have been the other way around. I should not have made that assumption. -- http://mail.pyt

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Chris Mellon
On 8/8/07, brad <[EMAIL PROTECTED]> wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to d

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Istvan Albert
On Aug 8, 9:38 am, brad <[EMAIL PROTECTED]> wrote: > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for trying to do this instead of just hanging? A message such as > this would be more appropri

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 09:38:49 -0400, brad wrote: > url_queue = Queue.Queue(256) > for subnet in subnets: > url_queue.put(subnet) > > The problem is that I have 512 things to add to the queue, but my limit > is half that... whoops. Shouldn't the interpreter tell me that I'm an > idiot for tr