[Python-3000] Useless methods in Queue module

Miguel Branco miguel.branco at cern.ch
Mon Jan 14 14:24:44 CET 2008


-1 if I may.

I use qsize() to sustain an average queue size (unreliably) but not  
allowing the queue to be full. Certainly, this could be done in some  
other way, but the existence of the method remains very useful.

cheers


On Jan 11, 2008, at 8:13 PM, Raymond Hettinger wrote:

> I proposed to remove three methods from the queue module, qsize(),  
> empty(), and full().  These are not reliable.  The RightWay (tm) is  
> to trap the Empty and Full exceptions or use the .join() approach.
>
> Raymond
>
>
> --- From the docs ---
>
> Queue.qsize()¶
>    Return the approximate size of the queue. Because of  
> multithreading semantics, this number is not reliable.
>
> Queue.empty()¶
>    Return True if the queue is empty, False otherwise. Because of  
> multithreading semantics, this is not reliable.
>
> Queue.full()¶
>    Return True if the queue is full, False otherwise. Because of  
> multithreading semantics, this is not reliable.
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/miguel.branco%40cern.ch

--
Miguel Branco, CERN - ATLAS Computing Group
MSN: msbranco at hotmail.com
   +41 22 76 71268 - http://cern.ch/mbranco/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20080114/9fc18c03/attachment.htm 


More information about the Python-3000 mailing list