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

Skip to content

Commit 6e6cb8e

Browse files
committed
Provide links to Python source where the code is short, readable and
informative adjunct to the docs. Forward-port of Raymond's r86225 and r86245 using the new source reST role added in #10334.
1 parent dbe7519 commit 6e6cb8e

29 files changed

Lines changed: 134 additions & 0 deletions

Doc/library/ast.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ helper provided in this module. The result will be a tree of objects whose
1919
classes all inherit from :class:`ast.AST`. An abstract syntax tree can be
2020
compiled into a Python code object using the built-in :func:`compile` function.
2121

22+
.. seealso::
23+
24+
Latest version of the :source:`ast module Python source code <Lib/ast.py>`
2225

2326
Node classes
2427
------------

Doc/library/atexit.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ The :mod:`atexit` module defines functions to register and unregister cleanup
1111
functions. Functions thus registered are automatically executed upon normal
1212
interpreter termination.
1313

14+
.. seealso::
15+
16+
Latest version of the :source:`atexit Python source code
17+
<Lib/atexit.py>`
18+
1419
Note: the functions registered via this module are not called when the program
1520
is killed by a signal not handled by Python, when a Python fatal internal error
1621
is detected, or when :func:`os._exit` is called.

Doc/library/bisect.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ approach. The module is called :mod:`bisect` because it uses a basic bisection
1414
algorithm to do its work. The source code may be most useful as a working
1515
example of the algorithm (the boundary conditions are already right!).
1616

17+
.. seealso::
18+
19+
Latest version of the :source:`bisect module Python source code
20+
<Lib/bisect.py>`
21+
1722
The following functions are provided:
1823

1924

Doc/library/calendar.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ in both directions. This matches the definition of the "proleptic Gregorian"
2121
calendar in Dershowitz and Reingold's book "Calendrical Calculations", where
2222
it's the base calendar for all computations.
2323

24+
.. seealso::
25+
26+
Latest version of the :source:`calendar module Python source code
27+
<Lib/calendar.py>`
2428

2529
.. class:: Calendar(firstweekday=0)
2630

Doc/library/cmd.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ command interpreters. These are often useful for test harnesses, administrative
1111
tools, and prototypes that will later be wrapped in a more sophisticated
1212
interface.
1313

14+
.. seealso::
15+
16+
Latest version of the :source:`cmd module Python source code <Lib/cmd.py>`
1417

1518
.. class:: Cmd(completekey='tab', stdin=None, stdout=None)
1619

Doc/library/collections.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ In addition to the concrete container classes, the collections module provides
3131
ABCs (abstract base classes) that can be used to test whether a class provides a
3232
particular interface, for example, whether it is hashable or a mapping.
3333

34+
.. seealso::
35+
36+
Latest version of the :source:`collections module Python source code
37+
<Lib/collections.py>`
38+
3439

3540
:class:`Counter` objects
3641
------------------------
@@ -1059,6 +1064,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
10591064

10601065
.. seealso::
10611066

1067+
* Latest version of the :source:`Python source code for the collections
1068+
abstract base classes <Lib/_abcoll.py>`
1069+
10621070
* `OrderedSet recipe <http://code.activestate.com/recipes/576694/>`_ for an
10631071
example built on :class:`MutableSet`.
10641072

Doc/library/contextlib.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This module provides utilities for common tasks involving the :keyword:`with`
99
statement. For more information see also :ref:`typecontextmanager` and
1010
:ref:`context-managers`.
1111

12+
.. seealso::
13+
14+
Latest version of the :source:`contextlib Python source code
15+
<Lib/contextlib.py>`
16+
1217
Functions provided:
1318

1419

Doc/library/dis.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ disassembling it. The CPython bytecode which this module takes as an
1010
input is defined in the file :file:`Include/opcode.h` and used by the compiler
1111
and the interpreter.
1212

13+
.. seealso::
14+
15+
Latest version of the :source:`dis module Python source code <Lib/dis.py>`
16+
1317
.. impl-detail::
1418

1519
Bytecode is an implementation detail of the CPython interpreter! No

Doc/library/filecmp.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ The :mod:`filecmp` module defines functions to compare files and directories,
1010
with various optional time/correctness trade-offs. For comparing files,
1111
see also the :mod:`difflib` module.
1212

13+
.. seealso::
14+
15+
Latest version of the :source:`filecmp Python source code
16+
<Lib/filecmp.py>`
17+
1318
The :mod:`filecmp` module defines the following functions:
1419

1520

Doc/library/fileinput.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ hook must be a function that takes two arguments, *filename* and *mode*, and
4444
returns an accordingly opened file-like object. Two useful hooks are already
4545
provided by this module.
4646

47+
.. seealso::
48+
49+
Latest version of the :source:`fileinput Python source code
50+
<Lib/fileinput.py>`
51+
4752
The following function is the primary interface of this module:
4853

4954

0 commit comments

Comments
 (0)