summaryrefslogtreecommitdiffstats
path: root/Lib/Queue.py
Commit message (Collapse)AuthorAgeFilesLines
* Simplified the new get/get_nowait/put/put_nowait implementations a bit.Tim Peters2004-07-121-27/+12
|
* Bug #788520: Queue class has logic error when non-blockingTim Peters2004-07-121-85/+62
| | | | | | | | | | | | | | | | | | | | I don't agree it had a bug (see the report), so this is *not* a candidate for backporting, but the docs were confusing and the Queue implementation was old enough to vote. Rewrote put/put_nowait/get/get_nowait from scratch, to use a pair of Conditions (not_full and not_empty), sharing a common mutex. The code is 1/4 the size now, and 6.25x easier to understand. For blocking with timeout, we also get to reuse (indirectly) the tedious timeout code from threading.Condition. The Full and Empty exceptions raised by non-blocking calls are now easy (instead of nearly impossible) to explain truthfully: Full is raised if and only if the Queue truly is full when the non-blocking put call checks the queue size, and similarly for Empty versus non-blocking get. What I don't know is whether the new implementation is slower (or faster) than the old one. I don't really care. Anyone who cares a lot is encouraged to check that.
* * Move collections.deque() in from the sandboxRaymond Hettinger2004-01-291-2/+3
| | | | | | * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming
* Add __all__ .Brett Cannon2003-07-011-0/+2
|
* Use the dummy_thread module in Queue.py and tempfile.py.Guido van Rossum2002-12-301-1/+4
| | | | | tempfile.py already contained code to let it run without threads present; for Queue.py this is considered a useful feature too.
* Patch #572628: Optional timeouts for put and get.Martin v. Löwis2002-10-151-17/+69
|
* Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)Raymond Hettinger2002-06-301-3/+1
|
* Fix bug 544473 - "Queue module can deadlock".Mark Hammond2002-04-191-14/+33
| | | | | Use try/finally to ensure all Queue locks remain stable. Includes test case. Bugfix candidate.
* removed __all__ from several modulesSkip Montanaro2001-02-181-2/+0
|
* added __all__ lists to a number of Python modulesSkip Montanaro2001-01-201-0/+2
| | | | | | | | added test script and expected output file as well this closes patch 103297. __all__ attributes will be added to other modules without first submitting a patch, just adding the necessary line to the test script to verify more-or-less correct implementation.
* Variant of Skip's patch 103246 (Remove unneeded string exception compat from ↵Tim Peters2001-01-151-13/+7
| | | | Queue).
* typos fixed by Rob HooftJeremy Hylton2000-06-281-1/+1
|
* Mass patch by Ka-Ping Yee:Guido van Rossum2000-02-021-1/+1
| | | | | | | | | | | 1. Comments at the beginning of the module, before functions, and before classes have been turned into docstrings. 2. Tabs are normalized to four spaces. Also, removed the "remove" function from dircmp.py, which reimplements list.remove() (it must have been very old).
* Make the maxsize constructor argument default to 0 (an unlimited queue size).Guido van Rossum1999-09-091-1/+1
|
* Tim Peters:Guido van Rossum1999-02-081-42/+40
| | | | | | | | | | | | | | + Implements a put_nowait method. + Adds a corresponding Queue.Full exception. + Simplifies the implementation by adding optional "block" args to get() and put(), and makes the old get_nowait() and new put_nowait() one-line redirections to get() and put(). + Uses (much) simpler logic for the nowait cases. + Regularizes the doc strings to something closer to "Guido style" <wink>. + Converts two stray tabs into spaces. + Removes confusing verbiage about the queue "not being available" from the docstrings -- never knew what that meant as a user, and after digging into the implementation still didn't know what it was trying to say.
* Replace all calls to acquire_lock() and release_lock() with acquire()Guido van Rossum1998-04-291-25/+25
| | | | and release() instead.
* Clarify that put *blocks* when the queue is full. Add some blankGuido van Rossum1998-04-091-1/+6
| | | | lines to doc strings.
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-85/+85
|
* (Queue.Empty): When class based exceptions are in force, derive thisBarry Warsaw1997-11-201-116/+130
| | | | | | | | class from the standard base exception Exception. Otherwise define Queue.Empty as a string exception. (Queue): 8-space to 4-space indentation conversion. Also, basically recast all method comments into docstrings.
* Some minute changes.Guido van Rossum1993-12-291-0/+1
|
* * Mass change: get rid of all init() methods, in favor of __init__()Guido van Rossum1993-12-171-3/+1
| | | | | | | constructors. There is no backward compatibility. Not everything has been tested. * aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as comments)
* New module implementing a multi-everything queue.Guido van Rossum1992-08-251-0/+122