Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ecfa45

Browse files
Expand abbreviations FIFO and LIFO.
1 parent 98019e1 commit 4ecfa45

6 files changed

Lines changed: 21 additions & 14 deletions

File tree

Doc/library/asyncio-eventloop.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ keywords to your callback, use :func:`functools.partial`. For example,
101101
called after :meth:`call_soon` returns, when control returns to the event
102102
loop.
103103

104-
This operates as a FIFO queue, callbacks are called in the order in
105-
which they are registered. Each callback will be called exactly once.
104+
This operates as a :abbr:`FIFO (first-in, first-out)` queue, callbacks
105+
are called in the order in which they are registered. Each callback
106+
will be called exactly once.
106107

107108
Any positional arguments after the callback will be passed to the
108109
callback when it is called.

Doc/library/collections.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,9 @@ the items are returned in the order their keys were first added.
987987
.. method:: popitem(last=True)
988988

989989
The :meth:`popitem` method for ordered dictionaries returns and removes a
990-
(key, value) pair. The pairs are returned in LIFO order if *last* is true
991-
or FIFO order if false.
990+
(key, value) pair. The pairs are returned in
991+
:abbr:`LIFO (last-in, first-out)` order if *last* is true
992+
or :abbr:`FIFO (first-in, first-out)` order if false.
992993

993994
.. method:: move_to_end(key, last=True)
994995

Doc/library/itertools.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ loops that truncate the stream.
591591
Return *n* independent iterators from a single iterable.
592592

593593
The following Python code helps explain what *tee* does (although the actual
594-
implementation is more complex and uses only a single underlying FIFO queue)::
594+
implementation is more complex and uses only a single underlying
595+
:abbr:`FIFO (first-in, first-out)` queue)::
595596

596597
def tee(iterable, n=2):
597598
it = iter(iterable)

Doc/library/multiprocessing.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,9 @@ primitives like locks.
644644
For passing messages one can use :func:`Pipe` (for a connection between two
645645
processes) or a queue (which allows multiple producers and consumers).
646646

647-
The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types are multi-producer,
648-
multi-consumer FIFO queues modelled on the :class:`queue.Queue` class in the
647+
The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types
648+
are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)`
649+
queues modelled on the :class:`queue.Queue` class in the
649650
standard library. They differ in that :class:`Queue` lacks the
650651
:meth:`~queue.Queue.task_done` and :meth:`~queue.Queue.join` methods introduced
651652
into Python 2.5's :class:`queue.Queue` class.

Doc/library/queue.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ availability of thread support in Python; see the :mod:`threading`
1616
module.
1717

1818
The module implements three types of queue, which differ only in the order in
19-
which the entries are retrieved. In a FIFO queue, the first tasks added are
20-
the first retrieved. In a LIFO queue, the most recently added entry is
19+
which the entries are retrieved. In a :abbr:`FIFO (first-in, first-out)`
20+
queue, the first tasks added are the first retrieved. In a
21+
:abbr:`LIFO (last-in, first-out)` queue, the most recently added entry is
2122
the first retrieved (operating like a stack). With a priority queue,
2223
the entries are kept sorted (using the :mod:`heapq` module) and the
2324
lowest valued entry is retrieved first.
@@ -27,14 +28,16 @@ The :mod:`queue` module defines the following classes and exceptions:
2728

2829
.. class:: Queue(maxsize=0)
2930

30-
Constructor for a FIFO queue. *maxsize* is an integer that sets the upperbound
31+
Constructor for a :abbr:`FIFO (first-in, first-out)` queue. *maxsize* is
32+
an integer that sets the upperbound
3133
limit on the number of items that can be placed in the queue. Insertion will
3234
block once this size has been reached, until queue items are consumed. If
3335
*maxsize* is less than or equal to zero, the queue size is infinite.
3436

3537
.. class:: LifoQueue(maxsize=0)
3638

37-
Constructor for a LIFO queue. *maxsize* is an integer that sets the upperbound
39+
Constructor for a :abbr:`LIFO (last-in, first-out)` queue. *maxsize* is
40+
an integer that sets the upperbound
3841
limit on the number of items that can be placed in the queue. Insertion will
3942
block once this size has been reached, until queue items are consumed. If
4043
*maxsize* is less than or equal to zero, the queue size is infinite.

Doc/library/unittest.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,9 +1388,9 @@ Test cases
13881388

13891389
Add a function to be called after :meth:`tearDown` to cleanup resources
13901390
used during the test. Functions will be called in reverse order to the
1391-
order they are added (LIFO). They are called with any arguments and
1392-
keyword arguments passed into :meth:`addCleanup` when they are
1393-
added.
1391+
order they are added (:abbr:`LIFO (last-in, first-out)`). They
1392+
are called with any arguments and keyword arguments passed into
1393+
:meth:`addCleanup` when they are added.
13941394

13951395
If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called,
13961396
then any cleanup functions added will still be called.

0 commit comments

Comments
 (0)