diff options
author | Guido van Rossum <guido@python.org> | 1998-04-09 14:25:32 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-04-09 14:25:32 (GMT) |
commit | c09e6b1c0ab8ea6e0f2cc77e87a602e909385c43 (patch) | |
tree | aaa22198ebf19877229a8875cec0f6822d24b27d /Lib | |
parent | 363ab1a613ec053b64ae097381af9c3295232cce (diff) | |
download | cpython-c09e6b1c0ab8ea6e0f2cc77e87a602e909385c43.zip cpython-c09e6b1c0ab8ea6e0f2cc77e87a602e909385c43.tar.gz cpython-c09e6b1c0ab8ea6e0f2cc77e87a602e909385c43.tar.bz2 |
Clarify that put *blocks* when the queue is full. Add some blank
lines to doc strings.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/Queue.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/Queue.py b/Lib/Queue.py index 6710153..843b9dc 100644 --- a/Lib/Queue.py +++ b/Lib/Queue.py @@ -44,7 +44,10 @@ class Queue: return n def put(self, item): - """Put an item into the queue.""" + """Put an item into the queue. + + If the queue is full, block until a free slot is avaiable. + """ self.fsema.acquire_lock() self.mutex.acquire_lock() was_empty = self._empty() @@ -57,6 +60,7 @@ class Queue: def get(self): """Gets and returns an item from the queue. + This method blocks if necessary until an item is available. """ self.esema.acquire_lock() @@ -74,6 +78,7 @@ class Queue: # raise Empty if the queue is empty or temporarily unavailable def get_nowait(self): """Gets and returns an item from the queue. + Only gets an item if one is immediately available, Otherwise this raises the Empty exception if the queue is empty or temporarily unavailable. |