[Python-Dev] Forgotten Py3.0 change to remove Queue.empty() andQueue.full()

Guido van Rossum guido at python.org
Sat Mar 7 16:36:41 CET 2009


On Sat, Mar 7, 2009 at 6:54 AM, Raymond Hettinger <python at rcn.com> wrote:
>
>> [MvL]
>>>
>>> At this point, I do request that the patch is reverted completely
>>> (i.e. that the documentation is restored), and that the qualification
>>> "not reliable!" is removed from the doc strings of the methods, as
>>> it is factually incorrect.
>>
>> I would be happy to restore the documentation.  You want the methods
>> back and I think that's sufficient reason to bring it back.
>>
>> The "not reliable" wording in the docstrings was put there by Guido 16
>> years ago.
>> http://svn.python.org/view/python/trunk/Lib/Queue.py?revision=3158&view=markup
>> Speak to him about this.  I'm done with this thread.
>
> Also, for years, the documentation also had a "not-reliable" notice:
>
>   Return ``True`` if the queue is empty, ``False`` otherwise.   Because of
> multithreading semantics, this is not reliable.
>
> Skip changed it to the present wording last year:
> http://svn.python.org/view/python/trunk/Doc/library/queue.rst?r1=59750&r2=59969

That was a long time ago, but I think I just meant the obvious warning
about multi-threaded use: if you are using full() and empty() and
other threads may also mutate the queue, then you cannot use them to
reliably prevent you from blocking. That's why eventually the
facilities for non-blocking get() and put() were added (I think by Tim
Peters).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list