diff options
author | Skip Montanaro <skip@pobox.com> | 2008-01-15 03:40:20 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2008-01-15 03:40:20 (GMT) |
commit | f233b0c454cbdca54c510f7b77fb3a64dcd05f1e (patch) | |
tree | dadd4058981b88edcc41ee3d4844c65c08dd5689 | |
parent | d4c2e8659c2ef5ae0ac9304fcf38d3008b249920 (diff) | |
download | cpython-f233b0c454cbdca54c510f7b77fb3a64dcd05f1e.zip cpython-f233b0c454cbdca54c510f7b77fb3a64dcd05f1e.tar.gz cpython-f233b0c454cbdca54c510f7b77fb3a64dcd05f1e.tar.bz2 |
Better (?) text describing the lack of guarantees provided by qsize(),
empty() and full().
-rw-r--r-- | Doc/library/queue.rst | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 0812b78..629a4b3 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -49,20 +49,25 @@ See the source code for details. The public methods are: .. method:: Queue.qsize() - Return the approximate size of the queue. Because of multithreading semantics, - this number is not reliable. + Return the approximate size of the queue. qsize() > 0 doesn't guarantee + that a subsequent get() will not block, nor that qsize() < maxsize + guarantee that put() will not block. .. method:: Queue.empty() - Return ``True`` if the queue is empty, ``False`` otherwise. Because of - multithreading semantics, this is not reliable. + Return ``True`` if the queue is empty, ``False`` otherwise. If empty() + returns ``True`` it doesn't guarantee that a subsequent call to put() + will not block. Similarly, if empty() returns ``False`` it doesn't + guarantee that a subsequent call to get() will not block. .. method:: Queue.full() - Return ``True`` if the queue is full, ``False`` otherwise. Because of - multithreading semantics, this is not reliable. + Return ``True`` if the queue is full, ``False`` otherwise. If full() + returns ``True`` it doesn't guarantee that a subsequent call to get() + will not block. Similarly, if full() returns ``False`` it doesn't + guarantee that a subsequent call to put() will not block. .. method:: Queue.put(item[, block[, timeout]]) |