[Python-3000] Useless methods in Queue module

Raymond Hettinger python at rcn.com
Fri Jan 11 20:13:21 CET 2008


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.


More information about the Python-3000 mailing list