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

Nick Coghlan ncoghlan at gmail.com
Wed Oct 12 11:51:36 CEST 2005

Guido van Rossum wrote:
> 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.

Actually, I think wanting to use a timeout is an artifact of a history of 
dealing with too many C libraries which don't provide a proper event-based or 
select-style interface (which means the calls have to time out periodically in 
order to respond gracefully to program shutdown requests).

However, because Queues are multi-producer, that isn't a problem - I just have 
to remember to push the shutdown request in through the Queue.

Basically, I'd fallen into the "trying-to-write-C-in-Python" trap and I simply 
didn't notice until I read the responses in this thread :)


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list