From e679a3702414570b022985b69043d0d684bb97cc Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 5 Nov 2010 23:58:42 +0000 Subject: [PATCH] Provide links to Python source in a handful of cases where the source is a generally helpful adjunct to the docs. --- Doc/library/ast.rst | 5 +++++ Doc/library/calendar.rst | 4 ++++ Doc/library/collections.rst | 7 +++++++ Doc/library/queue.rst | 5 +++++ Doc/library/random.rst | 5 +++++ Doc/library/textwrap.rst | 4 ++++ Doc/library/threading.rst | 4 ++++ Doc/library/userdict.rst | 5 +++++ 8 files changed, 39 insertions(+) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 82ca6e35c1a..c6209451717 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -28,6 +28,11 @@ 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 `ast module Python source code + `_ + Node classes ------------ diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 2f11aadeea5..30f2a9420bf 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -22,6 +22,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 `calendar module Python source code + `_ .. class:: Calendar([firstweekday]) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 7f98c591a60..6433cd290f7 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -44,6 +44,10 @@ In addition to containers, the collections module provides some ABCs provides a particular interface, for example, whether it is hashable or a mapping. +.. seealso:: + + Latest version of the `collections module Python source code + `_ :class:`Counter` objects ------------------------ @@ -970,6 +974,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin: .. seealso:: + * Latest version of the `Python source code for the collections abstract base classes + `_ + * `OrderedSet recipe `_ for an example built on :class:`MutableSet`. diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 4caa1bd0b35..4a00d0bcf95 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -24,6 +24,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 `queue module Python source code + `_ + The :mod:`Queue` module defines the following classes and exceptions: .. class:: Queue(maxsize=0) diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 935d60583ea..4306911dfc2 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -9,6 +9,11 @@ This module implements pseudo-random number generators for various distributions. +.. seealso:: + + Latest version of the `random module Python source code + `_ + For integers, uniform selection from a range. For sequences, 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 replacement. diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index a2db567fb5b..bfc63fb4c22 100644 --- a/Doc/library/textwrap.rst +++ b/Doc/library/textwrap.rst @@ -16,6 +16,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 `textwrap module Python source code + `_ .. function:: wrap(text[, width[, ...]]) diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 2028f8b4747..b22d3d12e6b 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -26,6 +26,10 @@ The :mod:`dummy_threading` module is provided for situations where Starting with Python 2.5, several Thread methods raise :exc:`RuntimeError` instead of :exc:`AssertionError` if called erroneously. +.. seealso:: + + Latest version of the `threading module Python source code + `_ This module defines the following functions and objects: diff --git a/Doc/library/userdict.rst b/Doc/library/userdict.rst index 9ddfde52657..ab9ab042761 100644 --- a/Doc/library/userdict.rst +++ b/Doc/library/userdict.rst @@ -19,6 +19,11 @@ available starting with Python version 2.2). Prior to the introduction of sub-classes that obtained new behaviors by overriding existing methods or adding new ones. +.. seealso:: + + Latest version of the `UserDict Python source code + `_ + The :mod:`UserDict` module defines the :class:`UserDict` class and :class:`DictMixin`: