summaryrefslogtreecommitdiff
path: root/Lib/Queue.py
AgeCommit message (Collapse)AuthorLines
2008-06-11give the threading API PEP 8 namesBenjamin Peterson-1/+1
2008-05-25Queue renaming reversal part 3: move module into place andGeorg Brandl-0/+244
change imports and other references. Closes #2925.
2008-05-11Moved the Queue module stub in lib-old.Alexandre Vassalotti-8/+0
2008-05-11Added stub for the Queue module to be renamed in 3.0.Alexandre Vassalotti-242/+6
Use the 3.0 module name to avoid spurious warnings.
2008-01-16Add queues will alternative fetch orders (priority based and stack based).Raymond Hettinger-2/+38
2008-01-15Refactor if/elif chain for clarity and speed. Remove dependency on ↵Raymond Hettinger-30/+23
subclasses having to implement _empty and _full.
2006-11-23... and the number of the counting shall be three.Raymond Hettinger-1/+1
2006-06-10document the class, not its initializerSkip Montanaro-4/+4
2006-03-25Don't decrement below zero. And add more tests.Raymond Hettinger-1/+2
2006-03-25Whitespace normalization.Tim Peters-1/+1
2006-03-24SF Patch #1455676: Simplify using Queues with daemon consumer threadsRaymond Hettinger-0/+45
Adds join() and task_done() methods to track when all enqueued tasks have been gotten and fully processed by daemon consumer threads.
2004-07-12Simplified the new get/get_nowait/put/put_nowait implementations a bit.Tim Peters-27/+12
2004-07-12Bug #788520: Queue class has logic error when non-blockingTim Peters-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.
2004-01-29* Move collections.deque() in from the sandboxRaymond Hettinger-2/+3
* Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming
2003-07-01Add __all__ .Brett Cannon-0/+2
2002-12-30Use the dummy_thread module in Queue.py and tempfile.py.Guido van Rossum-1/+4
tempfile.py already contained code to let it run without threads present; for Queue.py this is considered a useful feature too.
2002-10-15Patch #572628: Optional timeouts for put and get.Martin v. Löwis-17/+69
2002-06-30Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)Raymond Hettinger-3/+1
2002-04-19Fix bug 544473 - "Queue module can deadlock".Mark Hammond-14/+33
Use try/finally to ensure all Queue locks remain stable. Includes test case. Bugfix candidate.
2001-02-18removed __all__ from several modulesSkip Montanaro-2/+0
2001-01-20added __all__ lists to a number of Python modulesSkip Montanaro-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.
2001-01-15Variant of Skip's patch 103246 (Remove unneeded string exception compat from ↵Tim Peters-13/+7
Queue).
2000-06-28typos fixed by Rob HooftJeremy Hylton-1/+1
2000-02-02Mass patch by Ka-Ping Yee:Guido van Rossum-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).
1999-09-09Make the maxsize constructor argument default to 0 (an unlimited queue size).Guido van Rossum-1/+1
1999-02-08Tim Peters:Guido van Rossum-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.
1998-04-29Replace all calls to acquire_lock() and release_lock() with acquire()Guido van Rossum-25/+25
and release() instead.
1998-04-09Clarify that put *blocks* when the queue is full. Add some blankGuido van Rossum-1/+6
lines to doc strings.
1998-03-26Mass check-in after untabifying all files that need it.Guido van Rossum-85/+85
1997-11-20(Queue.Empty): When class based exceptions are in force, derive thisBarry Warsaw-101/+115
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.
1993-12-29Some minute changes.Guido van Rossum-0/+1
1993-12-17* Mass change: get rid of all init() methods, in favor of __init__()Guido van Rossum-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)
1992-08-25New module implementing a multi-everything queue.Guido van Rossum-0/+122