10000 Add autolink-preface directives at file level · python/cpython@95cc803 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95cc803

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

37 files changed

+239
-18
lines changed

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

57AE

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

Doc/library/dis.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
def myfunc(alist):
1313
return len(alist)
1414

15+
.. autolink-preface::
16+
:level: file
17+
18+
import dis
19+
1520
--------------
1621

1722
The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by

Doc/library/email.compat32-message.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
:noindex:
1010
:no-index:
1111

12+
.. autolink-preface::
13+
:level: file
14+
15+
import email
16+
from email import message_from_binary_file
1217

1318
The :class:`Message` class is very similar to the
1419
:class:`~email.message.EmailMessage` class, without the methods added by that

Doc/library/email.iterators.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
.. module:: email.iterators
55
:synopsis: Iterate over a message object tree.
66

7+
.. autolink-preface::
8+
:level: file
9+
10+
import email
11+
from email.iterators import _structure
12+
713
**Source code:** :source:`Lib/email/iterators.py`
814

915
--------------

Doc/library/email.message.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
.. sectionauthor:: R. David Murray <rdmurray@bitdance.com>,
88
Barry A. Warsaw <barry@python.org>
99

10+
.. autolink-preface::
11+
:level: file
12+
13+
from email import message_from_binary_file
14+
1015
**Source code:** :source:`Lib/email/message.py`
1116

1217
--------------

Doc/library/functools.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
import functools
1919
from functools import *
2020

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

2329
The :mod:`functools` module is for higher-order functions: functions that act on

Doc/library/graphlib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
import graphlib
1313
from graphlib import *
1414

15+
16+
.. autolink-preface::
17+
:level: file
18+
19+
import graphlib
20+
from graphlib import *
21+
1522
--------------
1623

1724

Doc/library/hashlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
import hashlib
1919

20+
.. autolink-preface::
21+
:level: file
22+
23+
import hashlib
2024

2125
--------------
2226

Doc/library/inspect.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
import inspect
77
from inspect import *
88

9+
.. autolink-preface::
10+
:level: file
11+
12+
import inspect
13+
from inspect import *
14+
915
.. module:: inspect
1016
:synopsis: Extract information and source code from live objects.
1117

Doc/library/ipaddress.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ This is the full module API reference—for an overview and introduction, see
3131
ip_network, IPv4Address, IPv4Interface, IPv4Network,
3232
)
3333

34+
.. autolink-preface::
35+
:level: file
36+
37+
import ipaddress
38+
from ipaddress import (
39+
ip_network, IPv4Address, IPv4Interface, IPv4Network,
40+
)
41+
42+
3443
Convenience factory functions
3544
-----------------------------
3645

Doc/library/itertools.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
import operator
1616
import random
1717

18+
.. autolink-preface::
19+
:level: file
20+
21+
from itertools import *
22+
import collections
23+
import math
24+
import operator
25+
import random
26+
1827
--------------
1928

2029
This module implements a number of :term:`iterator` building blocks inspired

Doc/library/operator.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
import operator
1414
from operator import itemgetter, iadd
1515

16+
.. autolink-preface::
17+
:level: file
18+
19+
import operator
20+
from operator import itemgetter, iadd
21+
1622
--------------
1723

1824
The :mod:`operator` module exports a set of efficient functions corresponding to

Doc/library/pathlib.rst

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

77
.. versionadded:: 3.4
88

9+
.. autolink-preface::
10+
:level: file
11+
12+
from pathlib import PurePath, PurePosixPath, PureWindowsPath
13+
914
**Source code:** :source:`Lib/pathlib/`
1015

1116
.. index:: single: path; operations

Doc/library/re.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
.. module:: re
55
:synopsis: Regular expression operations.
66

7+
.. autolink-preface::
8+
:level: file
9+
10+
import re
11+
712
.. moduleauthor:: Fredrik Lundh <fredrik@pythonware.com>
813
.. sectionauthor:: Andrew M. Kuchling <amk@amk.ca>
914

Doc/library/secrets.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
from secrets import *
1414
__name__ = '<doctest>'
1515

16+
.. autolink-preface::
17+
:level: file
18+
19+
from secrets import *
20+
21+
1622
**Source code:** :source:`Lib/secrets.py`
1723

1824
-------------

Doc/library/sqlite3.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
dst.close()
2121
del src, dst
2222

23+
.. autolink-preface::
24+
:level: file
25+
26+
import sqlite3
27+
2328
.. _sqlite3-intro:
2429

2530
SQLite is a C library that provides a lightweight disk-based database that

Doc/library/ssl.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
.. moduleauthor:: Bill Janssen <bill.janssen@gmail.com>
88
.. sectionauthor:: Bill Janssen <bill.janssen@gmail.com>
99

10-
**Source code:** :source:`Lib/ssl.py`
10+
.. testsetup::
11+
12+
import ssl
13+
14+
.. autolink-preface::
15+
:level: file
16+
17+
import ssl
1118

1219
.. index:: single: OpenSSL; (use in module ssl)
1320

Doc/library/statistics.rst

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

20+
.. autolink-preface::
21+
:level: file
22+
23+
from statistics import *
24+
import math
25+
2026
--------------
2127

2228
This module provides functions for calculating mathematical statistics of

Doc/library/struct.rst

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

66
from struct import *
77

8+
.. autolink-preface::
9+
:level: file
10+
11+
from struct import *
12+
813
.. module:: struct
914
:synopsis: Interpret bytes as packed binary data.
1015

Doc/library/turtle.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
import os
2020
os.remove("my_drawing.ps")
2121

22+
.. autolink-preface::
23+
:level: file
24+
25+
from turtle import *
26+
2227
--------------
2328

2429
Introduction

0 commit comments

Comments
 (0)
0