Skip to content

Commit 95cc803

Browse files
committed
Add autolink-preface directives at file level
1 parent 7e64ef7 commit 95cc803

37 files changed

Lines changed: 239 additions & 18 deletions

Doc/howto/functional.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Functional Programming HOWTO
55
********************************
66

7+
.. autolink-preface::
8+
:level: file
9+
10+
import functools
11+
import itertools
12+
13+
714
:Author: A. M. Kuchling
815
:Release: 0.32
916

Doc/howto/ipaddress.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
import ipaddress
44

5+
.. autolink-preface::
6+
:level: file
7+
8+
import ipaddress
9+
510
.. _ipaddress-howto:
611

712
***************************************

Doc/library/annotationlib.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
import annotationlib
1313
from annotationlib import *
1414

15+
.. autolink-preface::
16+
:level: file
17+
18+
import annotationlib
19+
from annotationlib import *
20+
1521
--------------
1622

1723
The :mod:`!annotationlib` module provides tools for introspecting
@@ -484,4 +490,3 @@ annotations from the class and puts them in a separate attribute:
484490
typ.__annotate__ = wrapped_annotate
485491
typ.classvars = classvars # Store the ClassVars in a separate attribute
486492
return typ
487-

Doc/library/ast.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
.. testsetup::
1111

12-
import ast
12+
import ast
13+
14+
.. autolink-preface::
15+
:level: file
16+
17+
import ast
1318

1419
**Source code:** :source:`Lib/ast.py`
1520

@@ -1221,6 +1226,7 @@ Control flow
12211226
... break
12221227
... else:
12231228
... continue
1229+
...
12241230
... """), indent=4))
12251231
Module(
12261232
body=[

Doc/library/collections.abc.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
import itertools
1919
__name__ = '<doctest>'
2020

21+
.. autolink-preface::
22+
:level: file
23+
24+
from collections.abc import *
25+
import itertools
26+
2127
--------------
2228

2329
This module provides :term:`abstract base classes <abstract base class>` that

Doc/library/collections.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import itertools
1616
__name__ = '<doctest>'
1717

18+
.. autolink-preface::
19+
:level: file
20+
21+
from collections import *
22+
import itertools
23+
1824
--------------
1925

2026
This module implements specialized container datatypes providing alternatives to

Doc/library/configparser.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ can be customized by end users easily.
5656
os.remove("example.ini")
5757
os.remove("override.ini")
5858

59+
.. autolink-preface::
60+
:level: file
61+
62+
import configparser
63+
5964

6065
Quick Start
6166
-----------

Doc/library/ctypes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,11 @@ Return types
490490
libc = CDLL(find_library('c'))
491491
strchr = libc.strchr
492492

493+
.. autolink-preface::
494+
:level: file
495+
496+
from ctypes import CDLL, c_char, c_char_p
497+
from ctypes.util import find_library
493498

494499
By default functions are assumed to return the C :c:expr:`int` type. Other
495500
return types can be specified by setting the :attr:`~_CFuncPtr.restype` attribute of the

Doc/library/decimal.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
# make sure other tests (outside this file) get a fresh context
2929
setcontext(Context())
3030

31+
.. autolink-preface::
32+
:level: file
33+
34+
import decimal
35+
import math
36+
from decimal import *
37+
38+
3139
--------------
3240

3341
The :mod:`decimal` module provides support for fast correctly rounded

Doc/library/difflib.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import sys
1616
from difflib import *
1717

18+
.. autolink-preface::
19+
:level: file
20+
21+
import sys
22+
from difflib import *
23+
1824
--------------
1925

2026
This module provides classes and functions for comparing sequences. It

0 commit comments

Comments
 (0)