diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index b5e08cbd53f..ca8af56f2da 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -9,6 +9,8 @@ **Source code:** :source:`Lib/ast.py` +-------------- + The :mod:`ast` module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index 98955e6aae9..13b01471907 100644 --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -9,6 +9,8 @@ **Source code:** :source:`Lib/bisect.py` +-------------- + This module provides support for maintaining a list in sorted order without having to sort the list after each insertion. For long lists of items with expensive comparison operations, this can be an improvement over the more common diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 06a12cdd8f5..f4952711cb8 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -8,6 +8,8 @@ **Source code:** :source:`Lib/calendar.py` +-------------- + This module allows you to output calendars like the Unix :program:`cal` program, and provides additional useful functions related to the calendar. By default, these calendars have Monday as the first day of the week, and Sunday as the last diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst index a0ae42510d7..464764d7934 100644 --- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -7,6 +7,8 @@ **Source code:** :source:`Lib/cmd.py` +-------------- + The :class:`Cmd` class provides a simple framework for writing line-oriented command interpreters. These are often useful for test harnesses, administrative tools, and prototypes that will later be wrapped in a more sophisticated diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index d5ade412e42..4096cbbad59 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -14,6 +14,8 @@ **Source code:** :source:`Lib/collections.py` +-------------- + This module implements specialized container datatypes providing alternatives to Python's general purpose built-in containers, :class:`dict`, :class:`list`, :class:`set`, and :class:`tuple`. diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst index 5c56a5d494f..a35ea569c17 100644 --- a/Doc/library/contextlib.rst +++ b/Doc/library/contextlib.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/contextlib.py` +-------------- + This module provides utilities for common tasks involving the :keyword:`with` statement. For more information see also :ref:`typecontextmanager` and :ref:`context-managers`. diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 1d21c49f3bd..79cc583b754 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/dis.py` +-------------- + The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by disassembling it. The CPython bytecode which this module takes as an input is defined in the file :file:`Include/opcode.h` and used by the compiler diff --git a/Doc/library/filecmp.rst b/Doc/library/filecmp.rst index ead85880541..e0ffff704ec 100644 --- a/Doc/library/filecmp.rst +++ b/Doc/library/filecmp.rst @@ -7,6 +7,8 @@ **Source code:** :source:`Lib/filecmp.py` +-------------- + The :mod:`filecmp` module defines functions to compare files and directories, with various optional time/correctness trade-offs. For comparing files, see also the :mod:`difflib` module. diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 1e71ebdcb9d..ac4431145d2 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -8,6 +8,8 @@ **Source code:** :source:`Lib/fileinput.py` +-------------- + This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see :func:`open`. diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst index 3b9a6c3aeb8..4ba6b77f8ed 100644 --- a/Doc/library/fnmatch.rst +++ b/Doc/library/fnmatch.rst @@ -11,6 +11,8 @@ **Source code:** :source:`Lib/fnmatch.py` +-------------- + This module provides support for Unix shell-style wildcards, which are *not* the same as regular expressions (which are documented in the :mod:`re` module). The special characters used in shell-style wildcards are: diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 320df28f5fc..3d31c116c83 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -9,6 +9,8 @@ **Source code:** :source:`Lib/glob.py` +-------------- + The :mod:`glob` module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell. No tilde expansion is done, but ``*``, ``?``, and character ranges expressed with ``[]`` will be correctly diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index f59c3b877e1..c8634ba2915 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -10,6 +10,8 @@ **Source code:** :source:`Lib/heapq.py` +-------------- + This module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm. diff --git a/Doc/library/keyword.rst b/Doc/library/keyword.rst index d86fef05180..173db23544a 100644 --- a/Doc/library/keyword.rst +++ b/Doc/library/keyword.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/keyword.py` +-------------- + This module allows a Python program to determine if a string is a keyword. diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst index ee965fe9036..dacf8aa002a 100644 --- a/Doc/library/linecache.rst +++ b/Doc/library/linecache.rst @@ -7,6 +7,8 @@ **Source code:** :source:`Lib/linecache.py` +-------------- + The :mod:`linecache` module allows one to get any line from any file, while attempting to optimize internally, using a cache, the common case where many lines are read from a single file. This is used by the :mod:`traceback` module diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 58b6702fda7..9ab12eea1d8 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -8,6 +8,8 @@ **Source code:** :source:`Lib/pprint.py` +-------------- + The :mod:`pprint` module provides a capability to "pretty-print" arbitrary Python data structures in a form which can be used as input to the interpreter. If the formatted structures include objects which are not fundamental Python diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index bc3821e2eb9..26336ef5158 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/queue.py` +-------------- + The :mod:`queue` module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The :class:`Queue` class in this diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 85253123aa5..f0c4add61a1 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/random.py` +-------------- + This module implements pseudo-random number generators for various distributions. diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst index a76aacc9f83..ab582370416 100644 --- a/Doc/library/sched.rst +++ b/Doc/library/sched.rst @@ -9,6 +9,8 @@ **Source code:** :source:`Lib/sched.py` +-------------- + The :mod:`sched` module defines a class which implements a general purpose event scheduler: diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst index 499ab5181a4..4b49a2f006b 100644 --- a/Doc/library/shelve.rst +++ b/Doc/library/shelve.rst @@ -9,6 +9,8 @@ **Source code:** :source:`Lib/shelve.py` +-------------- + A "shelf" is a persistent, dictionary-like object. The difference with "dbm" databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects --- anything that the :mod:`pickle` module can handle. diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 759dab13284..988ee4c178d 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -12,6 +12,8 @@ **Source code:** :source:`Lib/shutil.py` +-------------- + The :mod:`shutil` module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal. For operations on individual files, see also the diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 904df29d5fc..32fda13d261 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -13,6 +13,8 @@ **Source code:** :source:`Lib/string.py` +-------------- + String constants ---------------- diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 74e5b2ecf05..a81496206d7 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -8,6 +8,8 @@ **Source code:** :source:`Lib/textwrap.py` +-------------- + The :mod:`textwrap` module provides two convenience functions, :func:`wrap` and :func:`fill`, as well as :class:`TextWrapper`, the class that does all the work, and a utility function :func:`dedent`. If you're just wrapping or filling one diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 03ff44c597c..7f0628da660 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/threading.py` +-------------- + This module constructs higher-level threading interfaces on top of the lower level :mod:`_thread` module. See also the :mod:`queue` module. diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 9c05439e00c..577d7cca4c9 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -8,6 +8,8 @@ **Source code:** :source:`Lib/tokenize.py` +-------------- + The :mod:`tokenize` module provides a lexical scanner for Python source code, implemented in Python. The scanner in this module returns comments as tokens as well, making it useful for implementing "pretty-printers," including diff --git a/Doc/library/trace.rst b/Doc/library/trace.rst index 5a32482e692..c4ddc56cf22 100644 --- a/Doc/library/trace.rst +++ b/Doc/library/trace.rst @@ -6,6 +6,8 @@ **Source code:** :source:`Lib/trace.py` +-------------- + The :mod:`trace` module allows you to trace program execution, generate annotated statement coverage listings, print caller/callee relationships and list functions executed during a program run. It can be used in another program diff --git a/Doc/library/uu.rst b/Doc/library/uu.rst index 7c1d67c6e91..d61c178831a 100644 --- a/Doc/library/uu.rst +++ b/Doc/library/uu.rst @@ -7,6 +7,8 @@ **Source code:** :source:`Lib/uu.py` +-------------- + This module encodes and decodes files in uuencode format, allowing arbitrary binary data to be transferred over ASCII-only connections. Wherever a file argument is expected, the methods accept a file-like object. For backwards diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index b147fa55bed..d457095bf8f 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -1614,7 +1614,7 @@ memory jog without having to read all of the docs. In some cases, the pure Python source code can be helpful adjunct to the docs, so now some modules feature quick links to the latest version of the source code. For example, the :mod:`functools` module documentation has a quick link -at the top labeled *Source code* source:`Lib/functools.py`. +at the top labeled: *Source code* :source:`Lib/functools.py`. The docs now contain more examples and recipes. In particular, :mod:`re` module has an extensive section, :ref:`re-examples`. Likewise, the :mod:`itertools`