]> granicus.if.org Git - python/commitdiff
Provide links to Python source where the code is short, readable and
authorÉric Araujo <merwok@netwok.org>
Tue, 16 Nov 2010 19:13:50 +0000 (19:13 +0000)
committerÉric Araujo <merwok@netwok.org>
Tue, 16 Nov 2010 19:13:50 +0000 (19:13 +0000)
informative adjunct to the docs.  Forward-port of Raymond's r86225 and
r86245 using the new source reST role added in #10334.

29 files changed:
Doc/library/ast.rst
Doc/library/atexit.rst
Doc/library/bisect.rst
Doc/library/calendar.rst
Doc/library/cmd.rst
Doc/library/collections.rst
Doc/library/contextlib.rst
Doc/library/dis.rst
Doc/library/filecmp.rst
Doc/library/fileinput.rst
Doc/library/fnmatch.rst
Doc/library/functools.rst
Doc/library/glob.rst
Doc/library/heapq.rst
Doc/library/keyword.rst
Doc/library/linecache.rst
Doc/library/pprint.rst
Doc/library/queue.rst
Doc/library/quopri.rst
Doc/library/random.rst
Doc/library/sched.rst
Doc/library/shelve.rst
Doc/library/shutil.rst
Doc/library/string.rst
Doc/library/textwrap.rst
Doc/library/threading.rst
Doc/library/tokenize.rst
Doc/library/trace.rst
Doc/library/uu.rst

index 66b29e0946b85a551e8ee8fa64fb806541f9e0a0..a9821e1e8cf6c97a0e66ff544192addc8a58b55e 100644 (file)
@@ -19,6 +19,9 @@ helper provided in this module.  The result will be a tree of objects whose
 classes all inherit from :class:`ast.AST`.  An abstract syntax tree can be
 compiled into a Python code object using the built-in :func:`compile` function.
 
+.. seealso::
+
+   Latest version of the :source:`ast module Python source code <Lib/ast.py>`
 
 Node classes
 ------------
index 104c73027d2256c16f39139a4706438171e5113a..1ce45c4df5c716617da5fbb6023aaaf020c6a11f 100644 (file)
@@ -11,6 +11,11 @@ The :mod:`atexit` module defines functions to register and unregister cleanup
 functions.  Functions thus registered are automatically executed upon normal
 interpreter termination.
 
+.. seealso::
+
+   Latest version of the :source:`atexit Python source code
+   <Lib/atexit.py>`
+
 Note: the functions registered via this module are not called when the program
 is killed by a signal not handled by Python, when a Python fatal internal error
 is detected, or when :func:`os._exit` is called.
index eb231598edf15c31578895042bd47e120a80de14..ca853e0f8229d3a2b6d21d1f37bed96e1a0a0dfd 100644 (file)
@@ -14,6 +14,11 @@ approach.  The module is called :mod:`bisect` because it uses a basic bisection
 algorithm to do its work.  The source code may be most useful as a working
 example of the algorithm (the boundary conditions are already right!).
 
+.. seealso::
+
+   Latest version of the :source:`bisect module Python source code
+   <Lib/bisect.py>`
+
 The following functions are provided:
 
 
index c8dac49e3cf72127cdc8249c360f4023ec7d6aa8..4ebe616ade3bce28b5ee6509e6287227bab4e02b 100644 (file)
@@ -21,6 +21,10 @@ in both directions.  This matches the definition of the "proleptic Gregorian"
 calendar in Dershowitz and Reingold's book "Calendrical Calculations", where
 it's the base calendar for all computations.
 
+.. seealso::
+
+   Latest version of the :source:`calendar module Python source code
+   <Lib/calendar.py>`
 
 .. class:: Calendar(firstweekday=0)
 
index d0332aaf8f09f3d9d2558712115d460a8a78bc5e..53d62c5c946c32e7e829c72efdcf3b4b44495cdd 100644 (file)
@@ -11,6 +11,9 @@ command interpreters.  These are often useful for test harnesses, administrative
 tools, and prototypes that will later be wrapped in a more sophisticated
 interface.
 
+.. seealso::
+
+   Latest version of the :source:`cmd module Python source code <Lib/cmd.py>`
 
 .. class:: Cmd(completekey='tab', stdin=None, stdout=None)
 
index 439e3bf45c5809d518dc51d3657a4ce8eacdde31..e34e39479b05346cb1f2c219bc3ec12f473d05c6 100644 (file)
@@ -31,6 +31,11 @@ In addition to the concrete container classes, the collections module provides
 ABCs (abstract base classes) that can be used to test whether a class provides a
 particular interface, for example, whether it is hashable or a mapping.
 
+.. seealso::
+
+   Latest version of the :source:`collections module Python source code
+   <Lib/collections.py>`
+
 
 :class:`Counter` objects
 ------------------------
@@ -1059,6 +1064,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
 
 .. seealso::
 
+   * Latest version of the :source:`Python source code for the collections
+     abstract base classes <Lib/_abcoll.py>`
+
    * `OrderedSet recipe <http://code.activestate.com/recipes/576694/>`_ for an
      example built on :class:`MutableSet`.
 
index 35eb882f66319d8f8ecf26c2ec5a0c317e03b2eb..5e1a11a11649eefc05bb02be2216505a767847c1 100644 (file)
@@ -9,6 +9,11 @@ This module provides utilities for common tasks involving the :keyword:`with`
 statement. For more information see also :ref:`typecontextmanager` and
 :ref:`context-managers`.
 
+.. seealso::
+
+   Latest version of the :source:`contextlib Python source code
+   <Lib/contextlib.py>`
+
 Functions provided:
 
 
index b6f1d9f1a91c2bb2db5b88e9f8435e5ea1bb1701..cf880fcc020b97af114cec4be7a5cb3dd24f5587 100644 (file)
@@ -10,6 +10,10 @@ 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
 and the interpreter.
 
+.. seealso::
+
+   Latest version of the :source:`dis module Python source code <Lib/dis.py>`
+
 .. impl-detail::
 
    Bytecode is an implementation detail of the CPython interpreter!  No
index f57dcceff0ad6f5de5ef49e21989ab625388bbaa..d6cdd29cb51eba1d05ddde17ad9879fb525bed2a 100644 (file)
@@ -10,6 +10,11 @@ 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.
 
+.. seealso::
+
+   Latest version of the :source:`filecmp Python source code
+   <Lib/filecmp.py>`
+
 The :mod:`filecmp` module defines the following functions:
 
 
index 7055f32ab0c8a91761e6822fc1f04361b2e3bda0..9174830fc139936e04169400dbd4aa777fdf9bac 100644 (file)
@@ -44,6 +44,11 @@ hook must be a function that takes two arguments, *filename* and *mode*, and
 returns an accordingly opened file-like object. Two useful hooks are already
 provided by this module.
 
+.. seealso::
+
+   Latest version of the :source:`fileinput Python source code
+   <Lib/fileinput.py>`
+
 The following function is the primary interface of this module:
 
 
index 0352b5233da5df48ddd248202fc1559aa099b608..8af6c0b0bfd249bdc4621eb3dcf8a0b2e21dbae0 100644 (file)
@@ -33,6 +33,10 @@ module.  See module :mod:`glob` for pathname expansion (:mod:`glob` uses
 a period are not special for this module, and are matched by the ``*`` and ``?``
 patterns.
 
+.. seealso::
+
+   Latest version of the :source:`fnmatch Python source code
+   <Lib/fnmatch.py>`
 
 .. function:: fnmatch(filename, pattern)
 
index 8e97c5409ddfdcd864b8a44fdd30765da0f46527..58c2429fd1f252793c0c3be01e24dad7ac23213a 100644 (file)
@@ -13,6 +13,11 @@ The :mod:`functools` module is for higher-order functions: functions that act on
 or return other functions. In general, any callable object can be treated as a
 function for the purposes of this module.
 
+.. seealso::
+
+   Latest version of the :source:`functools Python source code
+   <Lib/functools.py>`
+
 The :mod:`functools` module defines the following functions:
 
 ..  function:: cmp_to_key(func)
index 3e0322d1c9e708d9fcd27b23159f681029269f94..0de763fd538c1923a3591431def0bbd0d4f46d86 100644 (file)
@@ -15,6 +15,9 @@ matched.  This is done by using the :func:`os.listdir` and
 subshell.  (For tilde and shell variable expansion, use
 :func:`os.path.expanduser` and :func:`os.path.expandvars`.)
 
+.. seealso::
+
+   Latest version of the :source:`glob module Python source code <Lib/glob.py>`
 
 .. function:: glob(pathname)
 
index 78beee9978815c1b3b390102299385b259520c55..67bda5698d1b276d86086c354d7a107006620a72 100644 (file)
 This module provides an implementation of the heap queue algorithm, also known
 as the priority queue algorithm.
 
+.. seealso::
+
+   Latest version of the :source:`heapq Python source code
+   <Lib/heapq.py>`
+
 Heaps are arrays for which ``heap[k] <= heap[2*k+1]`` and ``heap[k] <=
 heap[2*k+2]`` for all *k*, counting elements from zero.  For the sake of
 comparison, non-existing elements are considered to be infinite.  The
index a4bfa501bfe580b85a574ac528bfabd2386c9fff..4d8a1f143468e66563c02f2aba972921bccccc01 100644 (file)
@@ -19,3 +19,8 @@ This module allows a Python program to determine if a string is a keyword.
    keywords are defined to only be active when particular :mod:`__future__`
    statements are in effect, these will be included as well.
 
+
+.. seealso::
+
+   Latest version of the :source:`keyword module Python source code
+   <Lib/keyword.py>`
index 688e29730725290c91944fa6af6d8b6390be1f01..d8a9ff3af36fbb15a6a3e5e35386c000d635e92b 100644 (file)
@@ -11,6 +11,11 @@ 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
 to retrieve source lines for inclusion in  the formatted traceback.
 
+.. seealso::
+
+   Latest version of the :source:`linecache module Python source code
+   <Lib/linecache.py>`
+
 The :mod:`linecache` module defines the following functions:
 
 
index 932be754a29faf93bf42bbbb27cde5c27fe83829..82648a1e91e3647f3a2beaeff16010a11b0d983e 100644 (file)
@@ -21,6 +21,11 @@ width constraint.
 
 Dictionaries are sorted by key before the display is computed.
 
+.. seealso::
+
+   Latest version of the :source:`pprint module Python source code
+   <Lib/pprint.py>`
+
 The :mod:`pprint` module defines one class:
 
 .. First the implementation class:
index 0ee920bc6fef8e33ee8f502e776d3ef5c81b141a..424998eb707ad93f79f2b1cc73e4be8a8f0a96cd 100644 (file)
@@ -19,6 +19,11 @@ 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.
 
+.. seealso::
+
+   Latest version of the :source:`queue module Python source code
+   <Lib/queue.py>`
+
 The :mod:`queue` module defines the following classes and exceptions:
 
 .. class:: Queue(maxsize=0)
index d7c7204074e7220ae3ba993b8d1e700119f912c2..4eded5b7662bd5d701a4cb28fa83d432031c89a1 100644 (file)
@@ -17,6 +17,10 @@ few nonprintable characters; the base64 encoding scheme available via the
 :mod:`base64` module is more compact if there are many such characters, as when
 sending a graphics file.
 
+.. seealso::
+
+   Latest version of the :source:`quopri module Python source code
+   <Lib/quopri.py>`
 
 .. function:: decode(input, output, header=False)
 
index 55edcf8fef207a2bce26b5420b75c4b721ea58ad..7aa08942d8edec39593c092d9655310a0fdf75a1 100644 (file)
@@ -8,6 +8,11 @@
 This module implements pseudo-random number generators for various
 distributions.
 
+.. seealso::
+
+   Latest version of the :source:`random module Python source code
+   <Lib/random.py>`
+
 For integers, there is uniform selection from a range. For sequences, there is
 uniform selection of a random element, a function to generate a random
 permutation of a list in-place, and a function for random sampling without
index 0290ec41cdfad42f319719e6be38b45f51a2fa03..94f79915a29d65ed130c465699e3cf09d4399eb4 100644 (file)
 The :mod:`sched` module defines a class which implements a general purpose event
 scheduler:
 
+.. seealso::
+
+   Latest version of the :source:`sched module Python source code
+   <Lib/sched.py>`
 
 .. class:: scheduler(timefunc, delayfunc)
 
index f5374c9ed7fe480f3cf4462ad87bc384afc9cce8..512788c9c997813ce1f03d82726c21b5db91f20a 100644 (file)
@@ -13,6 +13,10 @@ arbitrary Python objects --- anything that the :mod:`pickle` module can handle.
 This includes most class instances, recursive data types, and objects containing
 lots of shared  sub-objects.  The keys are ordinary strings.
 
+.. seealso::
+
+   Latest version of the :source:`shelve module Python source code
+   <Lib/shelve.py>`
 
 .. function:: open(filename, flag='c', protocol=None, writeback=False)
 
index e9dfe65a6f2bd6fb7b8d290c35fc25cd982ffff5..01448767194a8d6c863d21cc94cad360068d6923 100644 (file)
@@ -15,6 +15,11 @@ collections of files.  In particular, functions are provided  which support file
 copying and removal. For operations on individual files, see also the
 :mod:`os` module.
 
+.. seealso::
+
+   Latest version of the :source:`shutil module Python source code
+   <Lib/shutil.py>`
+
 .. warning::
 
    Even the higher-level file copying functions (:func:`copy`, :func:`copy2`)
@@ -26,6 +31,7 @@ copying and removal. For operations on individual files, see also the
    not be correct. On Windows, file owners, ACLs and alternate data streams
    are not copied.
 
+
 Directory and files operations
 ------------------------------
 
index 69cc25bbdf457b72e3c1fefda0c8cfad410d1dcc..b785fc2c048c0db65cd40f2425c813d86e480858 100644 (file)
@@ -15,6 +15,11 @@ section, and also the string-specific methods described in the
 :ref:`string-formatting` section.  Also, see the :mod:`re` module for
 string functions based on regular expressions.
 
+.. seealso::
+
+   Latest version of the :source:`string module Python source code
+   <Lib/string.py>`
+
 
 String constants
 ----------------
index f66416f3c62788d4f05845502a384f4b355cea9a..f8817013b5faee340d682feae70fc1b065d0c4fe 100644 (file)
@@ -13,6 +13,10 @@ and a utility function  :func:`dedent`.  If you're just wrapping or filling one
 or two  text strings, the convenience functions should be good enough;
 otherwise,  you should use an instance of :class:`TextWrapper` for efficiency.
 
+.. seealso::
+
+   Latest version of the :source:`textwrap module Python source code
+   <Lib/textwrap.py>`
 
 .. function:: wrap(text, width=70, **kwargs)
 
index 702f4beeff1fdda0352e20d0efe829af50194583..d3d7d9e612562a8369c255d7faf7562ddc38a832 100644 (file)
@@ -17,6 +17,11 @@ The :mod:`dummy_threading` module is provided for situations where
    methods and functions in this module in the Python 2.x series are still
    supported by this module.
 
+.. seealso::
+
+   Latest version of the :source:`threading module Python source code
+   <Lib/threading.py>`
+
 This module defines the following functions and objects:
 
 
index 6a96609596e40f76298e68f6f4d654af54f898fb..d7ae6382e4e3d5784b6fd2dfa0ed29938c6e8ffd 100644 (file)
@@ -12,6 +12,11 @@ implemented in Python.  The scanner in this module returns comments as tokens
 as well, making it useful for implementing "pretty-printers," including
 colorizers for on-screen displays.
 
+.. seealso::
+
+   Latest version of the :source:`tokenize module Python source code
+   <Lib/tokenize.py>`
+
 The primary entry point is a :term:`generator`:
 
 .. function:: tokenize(readline)
index f90f44b33e88c0c6d92ffdeaf42ad56cdcddf593..878fbed7ea1ad0007edfcd1d7217d84183d52efa 100644 (file)
@@ -10,6 +10,10 @@ annotated statement coverage listings, print caller/callee relationships and
 list functions executed during a program run.  It can be used in another program
 or from the command line.
 
+.. seealso::
+
+   Latest version of the :source:`trace module Python source code
+   <Lib/trace.py>`
 
 .. _trace-cli:
 
index 7813e448e8142f7eec50f095ef22eb427fc9184d..53d269b967dca215dace83c87abb9d408c778ec4 100644 (file)
@@ -21,6 +21,10 @@ that, when required, the mode is ``'rb'`` or ``'wb'`` on Windows.
 
 This code was contributed by Lance Ellinghouse, and modified by Jack Jansen.
 
+.. seealso::
+
+   Latest version of the :source:`uu module Python source code <Lib/uu.py>`
+
 The :mod:`uu` module defines the following functions: