Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-13 Thread Gustavo J. A. M. Carneiro
I'd just like to point out that Queue is not quite as useful as people seem to think in this thread. The main problem is that I can't integrate Queue into a select/poll based main loop. The other day I wanted extended a python main loop, which uses poll(), to be thread safe, so I could queue

[Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Nick Coghlan
The multi-processing discussion reminded me that I have a few problems I run into every time I try to use Queue objects. My first problem is finding it: Py from threading import Queue # Nope Traceback (most recent call last): File stdin, line 1, in ? ImportError: cannot import name Queue Py

Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Guido van Rossum
On 10/11/05, Nick Coghlan [EMAIL PROTECTED] wrote: The multi-processing discussion reminded me that I have a few problems I run into every time I try to use Queue objects. My first problem is finding it: Py from threading import Queue # Nope Traceback (most recent call last): File

Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Josiah Carlson
Guido van Rossum [EMAIL PROTECTED] wrote: Optionally, the existing put and get methods could be deprecated, with the goal of eventually changing their signature to match the put_wait and get_wait methods above. Apart from trying to guess the API without reading the docs (:-), what

Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Tim Peters
[Guido] Apart from trying to guess the API without reading the docs (:-), what are the use cases for using put/get with a timeout? I have a feeling it's not that common. [Josiah Carlson] With timeout=0, a shared connection/resource pool (perhaps DB, etc., I use one in the tuple space

Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Guido van Rossum
On 10/11/05, Tim Peters [EMAIL PROTECTED] wrote: Guido understands use cases for blocking and non-blocking put/get, and Queue always supported those possibilities. The timeout argument got added later, and it's not really clear _why_ it was added. timeout=0 isn't a sane use case (because the

Re: [Python-Dev] Making Queue.Queue easier to use

2005-10-11 Thread Josiah Carlson
[Guido] Apart from trying to guess the API without reading the docs (:-), what are the use cases for using put/get with a timeout? I have a feeling it's not that common. [Josiah Carlson] With timeout=0, a shared connection/resource pool (perhaps DB, etc., I use one in the tuple space