diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-16 06:31:54 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-16 06:31:54 (GMT) |
commit | 4ecfa455ae47bd955857348238c8bf8476819a1e (patch) | |
tree | 9b95caf33bcc54b96eaeb875a7c8cfd7db5c2809 /Doc/library | |
parent | 98019e1cf6dec54ca6c56ceb150869c1430bfda3 (diff) | |
download | cpython-4ecfa455ae47bd955857348238c8bf8476819a1e.zip cpython-4ecfa455ae47bd955857348238c8bf8476819a1e.tar.gz cpython-4ecfa455ae47bd955857348238c8bf8476819a1e.tar.bz2 |
Expand abbreviations FIFO and LIFO.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 5 | ||||
-rw-r--r-- | Doc/library/collections.rst | 5 | ||||
-rw-r--r-- | Doc/library/itertools.rst | 3 | ||||
-rw-r--r-- | Doc/library/multiprocessing.rst | 5 | ||||
-rw-r--r-- | Doc/library/queue.rst | 11 | ||||
-rw-r--r-- | Doc/library/unittest.rst | 6 |
6 files changed, 21 insertions, 14 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index f68b19d..a25f9d1 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -101,8 +101,9 @@ keywords to your callback, use :func:`functools.partial`. For example, called after :meth:`call_soon` returns, when control returns to the event loop. - This operates as a FIFO queue, callbacks are called in the order in - which they are registered. Each callback will be called exactly once. + This operates as a :abbr:`FIFO (first-in, first-out)` queue, callbacks + are called in the order in which they are registered. Each callback + will be called exactly once. Any positional arguments after the callback will be passed to the callback when it is called. diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index b67db53..e41f4cc 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -987,8 +987,9 @@ the items are returned in the order their keys were first added. .. method:: popitem(last=True) The :meth:`popitem` method for ordered dictionaries returns and removes a - (key, value) pair. The pairs are returned in LIFO order if *last* is true - or FIFO order if false. + (key, value) pair. The pairs are returned in + :abbr:`LIFO (last-in, first-out)` order if *last* is true + or :abbr:`FIFO (first-in, first-out)` order if false. .. method:: move_to_end(key, last=True) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 8376f1a..d80bef3 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -591,7 +591,8 @@ loops that truncate the stream. Return *n* independent iterators from a single iterable. The following Python code helps explain what *tee* does (although the actual - implementation is more complex and uses only a single underlying FIFO queue):: + implementation is more complex and uses only a single underlying + :abbr:`FIFO (first-in, first-out)` queue):: def tee(iterable, n=2): it = iter(iterable) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 1b1d386..b2b02b0 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -644,8 +644,9 @@ primitives like locks. For passing messages one can use :func:`Pipe` (for a connection between two processes) or a queue (which allows multiple producers and consumers). -The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types are multi-producer, -multi-consumer FIFO queues modelled on the :class:`queue.Queue` class in the +The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types +are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` +queues modelled on the :class:`queue.Queue` class in the standard library. They differ in that :class:`Queue` lacks the :meth:`~queue.Queue.task_done` and :meth:`~queue.Queue.join` methods introduced into Python 2.5's :class:`queue.Queue` class. diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 1cb0935..e3eaa3f 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -16,8 +16,9 @@ availability of thread support in Python; see the :mod:`threading` module. The module implements three types of queue, which differ only in the order in -which the entries are retrieved. In a FIFO queue, the first tasks added are -the first retrieved. In a LIFO queue, the most recently added entry is +which the entries are retrieved. In a :abbr:`FIFO (first-in, first-out)` +queue, the first tasks added are the first retrieved. In a +:abbr:`LIFO (last-in, first-out)` queue, the most recently added entry is the first retrieved (operating like a stack). With a priority queue, the entries are kept sorted (using the :mod:`heapq` module) and the lowest valued entry is retrieved first. @@ -27,14 +28,16 @@ The :mod:`queue` module defines the following classes and exceptions: .. class:: Queue(maxsize=0) - Constructor for a FIFO queue. *maxsize* is an integer that sets the upperbound + Constructor for a :abbr:`FIFO (first-in, first-out)` queue. *maxsize* is + an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If *maxsize* is less than or equal to zero, the queue size is infinite. .. class:: LifoQueue(maxsize=0) - Constructor for a LIFO queue. *maxsize* is an integer that sets the upperbound + Constructor for a :abbr:`LIFO (last-in, first-out)` queue. *maxsize* is + an integer that sets the upperbound limit on the number of items that can be placed in the queue. Insertion will block once this size has been reached, until queue items are consumed. If *maxsize* is less than or equal to zero, the queue size is infinite. diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 8482f20..55a6aaf 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1388,9 +1388,9 @@ Test cases Add a function to be called after :meth:`tearDown` to cleanup resources used during the test. Functions will be called in reverse order to the - order they are added (LIFO). They are called with any arguments and - keyword arguments passed into :meth:`addCleanup` when they are - added. + order they are added (:abbr:`LIFO (last-in, first-out)`). They + are called with any arguments and keyword arguments passed into + :meth:`addCleanup` when they are added. If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then any cleanup functions added will still be called. |