Skip to content

Commit 12e696b

Browse files
matrixisebrettcannon
authored andcommitted
bpo-35042: Use the :pep: role where a PEP is specified (#10036)
1 parent 9e14e49 commit 12e696b

40 files changed

+95
-94
lines changed

Doc/distutils/apiref.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1393,11 +1393,11 @@ This module provides the :class:`FileList` class, used for poking about the
13931393
filesystem and building lists of files.
13941394

13951395

1396-
:mod:`distutils.log` --- Simple PEP 282-style logging
1397-
=====================================================
1396+
:mod:`distutils.log` --- Simple :pep:`282`-style logging
1397+
========================================================
13981398

13991399
.. module:: distutils.log
1400-
:synopsis: A simple logging mechanism, 282-style
1400+
:synopsis: A simple logging mechanism, :pep:`282`-style
14011401

14021402

14031403
:mod:`distutils.spawn` --- Spawn a sub-process

Doc/howto/clinic.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ All Argument Clinic converters accept the following arguments:
765765

766766
``annotation``
767767
The annotation value for this parameter. Not currently supported,
768-
because PEP 8 mandates that the Python library may not use
768+
because :pep:`8` mandates that the Python library may not use
769769
annotations.
770770

771771
In addition, some converters accept additional arguments. Here is a list

Doc/library/abc.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
====================================
33

44
.. module:: abc
5-
:synopsis: Abstract base classes according to PEP 3119.
5+
:synopsis: Abstract base classes according to :pep:`3119`.
66

77
.. moduleauthor:: Guido van Rossum
88
.. sectionauthor:: Georg Brandl

Doc/library/pkgutil.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ support.
6363

6464
.. deprecated:: 3.3
6565
This emulation is no longer needed, as the standard import mechanism
66-
is now fully PEP 302 compliant and available in :mod:`importlib`.
66+
is now fully :pep:`302` compliant and available in :mod:`importlib`.
6767

6868

6969
.. class:: ImpLoader(fullname, file, filename, etc)
@@ -72,7 +72,7 @@ support.
7272

7373
.. deprecated:: 3.3
7474
This emulation is no longer needed, as the standard import mechanism
75-
is now fully PEP 302 compliant and available in :mod:`importlib`.
75+
is now fully :pep:`302` compliant and available in :mod:`importlib`.
7676

7777

7878
.. function:: find_loader(fullname)
@@ -86,7 +86,7 @@ support.
8686

8787
.. versionchanged:: 3.3
8888
Updated to be based directly on :mod:`importlib` rather than relying
89-
on the package internal PEP 302 import emulation.
89+
on the package internal :pep:`302` import emulation.
9090

9191
.. versionchanged:: 3.4
9292
Updated to be based on :pep:`451`
@@ -103,7 +103,7 @@ support.
103103

104104
.. versionchanged:: 3.3
105105
Updated to be based directly on :mod:`importlib` rather than relying
106-
on the package internal PEP 302 import emulation.
106+
on the package internal :pep:`302` import emulation.
107107

108108

109109
.. function:: get_loader(module_or_name)
@@ -118,7 +118,7 @@ support.
118118

119119
.. versionchanged:: 3.3
120120
Updated to be based directly on :mod:`importlib` rather than relying
121-
on the package internal PEP 302 import emulation.
121+
on the package internal :pep:`302` import emulation.
122122

123123
.. versionchanged:: 3.4
124124
Updated to be based on :pep:`451`
@@ -139,7 +139,7 @@ support.
139139

140140
.. versionchanged:: 3.3
141141
Updated to be based directly on :mod:`importlib` rather than relying
142-
on the package internal PEP 302 import emulation.
142+
on the package internal :pep:`302` import emulation.
143143

144144

145145
.. function:: iter_modules(path=None, prefix='')
@@ -160,7 +160,7 @@ support.
160160

161161
.. versionchanged:: 3.3
162162
Updated to be based directly on :mod:`importlib` rather than relying
163-
on the package internal PEP 302 import emulation.
163+
on the package internal :pep:`302` import emulation.
164164

165165

166166
.. function:: walk_packages(path=None, prefix='', onerror=None)
@@ -199,7 +199,7 @@ support.
199199

200200
.. versionchanged:: 3.3
201201
Updated to be based directly on :mod:`importlib` rather than relying
202-
on the package internal PEP 302 import emulation.
202+
on the package internal :pep:`302` import emulation.
203203

204204

205205
.. function:: get_data(package, resource)

Doc/library/test.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ The :mod:`test.support` module defines the following functions:
392392

393393
.. function:: make_legacy_pyc(source)
394394

395-
Move a PEP 3147/488 pyc file to its legacy pyc location and return the file
395+
Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return the file
396396
system path to the legacy pyc file. The *source* value is the file system
397397
path to the source file. It does not need to exist, however the PEP
398398
3147/488 pyc file must exist.

Doc/library/typing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
========================================
33

44
.. module:: typing
5-
:synopsis: Support for type hints (see PEP 484).
5+
:synopsis: Support for type hints (see :pep:`484`).
66

77
.. versionadded:: 3.5
88

Doc/library/wsgiref.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ input, output, and error streams.
739739

740740
.. function:: read_environ()
741741

742-
Transcode CGI variables from ``os.environ`` to PEP 3333 "bytes in unicode"
742+
Transcode CGI variables from ``os.environ`` to :pep:`3333` "bytes in unicode"
743743
strings, returning a new dictionary. This function is used by
744744
:class:`CGIHandler` and :class:`IISCGIHandler` in place of directly using
745745
``os.environ``, which is not necessarily WSGI-compliant on all platforms

Doc/library/zipimport.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ doesn't contain :file:`.pyc` files, importing may be rather slow.
3939

4040
:pep:`273` - Import Modules from Zip Archives
4141
Written by James C. Ahlstrom, who also provided an implementation. Python 2.3
42-
follows the specification in PEP 273, but uses an implementation written by Just
43-
van Rossum that uses the import hooks described in PEP 302.
42+
follows the specification in :pep:`273`, but uses an implementation written by Just
43+
van Rossum that uses the import hooks described in :pep:`302`.
4444

4545
:pep:`302` - New Import Hooks
4646
The PEP to add the import hooks that help this module work.

Doc/whatsnew/2.0.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ python-dev. Therefore, a relatively formal process has been set up to write
111111
Python Enhancement Proposals (PEPs), modelled on the Internet RFC process. PEPs
112112
are draft documents that describe a proposed new feature, and are continually
113113
revised until the community reaches a consensus, either accepting or rejecting
114-
the proposal. Quoting from the introduction to PEP 1, "PEP Purpose and
114+
the proposal. Quoting from the introduction to :pep:`1`, "PEP Purpose and
115115
Guidelines":
116116

117117

@@ -127,11 +127,11 @@ Guidelines":
127127
that have gone into Python. The PEP author is responsible for building
128128
consensus within the community and documenting dissenting opinions.
129129

130-
Read the rest of PEP 1 for the details of the PEP editorial process, style, and
130+
Read the rest of :pep:`1` for the details of the PEP editorial process, style, and
131131
format. PEPs are kept in the Python CVS tree on SourceForge, though they're not
132132
part of the Python 2.0 distribution, and are also available in HTML form from
133133
https://www.python.org/dev/peps/. As of September 2000, there are 25 PEPS, ranging
134-
from PEP 201, "Lockstep Iteration", to PEP 225, "Elementwise/Objectwise
134+
from :pep:`201`, "Lockstep Iteration", to PEP 225, "Elementwise/Objectwise
135135
Operators".
136136

137137
.. ======================================================================

Doc/whatsnew/2.1.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ anyway).
112112

113113
Compatibility concerns have led to nested scopes being introduced gradually; in
114114
Python 2.1, they aren't enabled by default, but can be turned on within a module
115-
by using a future statement as described in PEP 236. (See the following section
116-
for further discussion of PEP 236.) In Python 2.2, nested scopes will become
115+
by using a future statement as described in :pep:`236`. (See the following section
116+
for further discussion of :pep:`236`.) In Python 2.2, nested scopes will become
117117
the default and there will be no way to turn them off, but users will have had
118118
all of 2.1's lifetime to fix any breakage resulting from their introduction.
119119

@@ -213,7 +213,7 @@ otherwise it will call the appropriate method and can return any Python object.
213213

214214
There are also corresponding changes of interest to C programmers; there's a new
215215
slot ``tp_richcmp`` in type objects and an API for performing a given rich
216-
comparison. I won't cover the C API here, but will refer you to PEP 207, or to
216+
comparison. I won't cover the C API here, but will refer you to :pep:`207`, or to
217217
2.1's C API documentation, for the full list of related functions.
218218

219219

@@ -548,7 +548,7 @@ registering software at the Vaults is optional, and many people don't bother.
548548
As a first small step toward fixing the problem, Python software packaged using
549549
the Distutils :command:`sdist` command will include a file named
550550
:file:`PKG-INFO` containing information about the package such as its name,
551-
version, and author (metadata, in cataloguing terminology). PEP 241 contains
551+
version, and author (metadata, in cataloguing terminology). :pep:`241` contains
552552
the full list of fields that can be present in the :file:`PKG-INFO` file. As
553553
people began to package their software using Python 2.1, more and more packages
554554
will include metadata, making it possible to build automated cataloguing systems
@@ -561,7 +561,7 @@ package to a catalog server.
561561
You can start creating packages containing :file:`PKG-INFO` even if you're not
562562
using Python 2.1, since a new release of the Distutils will be made for users of
563563
earlier Python versions. Version 1.0.2 of the Distutils includes the changes
564-
described in PEP 241, as well as various bugfixes and enhancements. It will be
564+
described in :pep:`241`, as well as various bugfixes and enhancements. It will be
565565
available from the Distutils SIG at https://www.python.org/community/sigs/current/distutils-sig/.
566566

567567

Doc/whatsnew/2.5.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Package uploading was implemented by Martin von Löwis and Richard Jones.
256256
PEP 328: Absolute and Relative Imports
257257
======================================
258258

259-
The simpler part of PEP 328 was implemented in Python 2.4: parentheses could now
259+
The simpler part of :pep:`328` was implemented in Python 2.4: parentheses could now
260260
be used to enclose the names imported from a module using the ``from ... import
261261
...`` statement, making it easier to import many different names.
262262

@@ -529,7 +529,7 @@ chance to run. The syntactic restriction that you couldn't mix :keyword:`yield`
529529
statements with a ``try...finally`` suite has therefore been removed. This
530530
seems like a minor bit of language trivia, but using generators and
531531
``try...finally`` is actually necessary in order to implement the
532-
:keyword:`with` statement described by PEP 343. I'll look at this new statement
532+
:keyword:`with` statement described by :pep:`343`. I'll look at this new statement
533533
in the following section.
534534

535535
Another even more esoteric effect of this change: previously, the
@@ -1483,7 +1483,7 @@ complete list of changes, or look through the SVN logs for all the details.
14831483
2.4, so this completes the removal of the feature.
14841484

14851485
* The :mod:`pkgutil` module, containing various utility functions for finding
1486-
packages, was enhanced to support PEP 302's import hooks and now also works for
1486+
packages, was enhanced to support :pep:`302`'s import hooks and now also works for
14871487
packages stored in ZIP-format archives. (Contributed by Phillip J. Eby.)
14881488

14891489
* The pybench benchmark suite by Marc-André Lemburg is now included in the
@@ -2043,7 +2043,7 @@ between web servers and Python web applications and is described in :pep:`333`.
20432043
The :mod:`wsgiref` package is a reference implementation of the WSGI
20442044
specification.
20452045

2046-
.. XXX should this be in a PEP 333 section instead?
2046+
.. XXX should this be in a :pep:`333` section instead?
20472047
20482048
The package includes a basic HTTP server that will run a WSGI application; this
20492049
server is useful for debugging but isn't intended for production use. Setting

Doc/whatsnew/3.3.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ exist in parallel; over time, this compatibility should be phased out.
217217

218218
On the Python side, there should be no downside to this change.
219219

220-
On the C API side, PEP 393 is fully backward compatible. The legacy API
220+
On the C API side, :pep:`393` is fully backward compatible. The legacy API
221221
should remain available at least five years. Applications using the legacy
222222
API will not fully benefit of the memory reduction, or - worse - may use
223223
a bit more memory, because Python may have to maintain two versions of each
@@ -2082,7 +2082,7 @@ Add a new :class:`types.MappingProxyType` class: Read-only proxy of a mapping.
20822082

20832083

20842084
The new functions :func:`types.new_class` and :func:`types.prepare_class` provide support
2085-
for PEP 3115 compliant dynamic type creation. (:issue:`14588`)
2085+
for :pep:`3115` compliant dynamic type creation. (:issue:`14588`)
20862086

20872087

20882088
unittest
@@ -2396,7 +2396,7 @@ Porting Python code
23962396
case of working with :term:`path entry finders <path entry finder>`.
23972397

23982398
* :mod:`pkgutil` has been converted to use :mod:`importlib` internally. This
2399-
eliminates many edge cases where the old behaviour of the PEP 302 import
2399+
eliminates many edge cases where the old behaviour of the :pep:`302` import
24002400
emulation failed to match the behaviour of the real import system. The
24012401
import emulation itself is still present, but is now deprecated. The
24022402
:func:`pkgutil.iter_importers` and :func:`pkgutil.walk_packages` functions
@@ -2472,7 +2472,7 @@ Porting C code
24722472
functions using this type are deprecated (but will stay available for
24732473
at least five years). If you were using low-level Unicode APIs to
24742474
construct and access unicode objects and you want to benefit of the
2475-
memory footprint reduction provided by PEP 393, you have to convert
2475+
memory footprint reduction provided by :pep:`393`, you have to convert
24762476
your code to the new :doc:`Unicode API <../c-api/unicode>`.
24772477

24782478
However, if you only have been using high-level functions such as

Misc/NEWS.d/3.5.0a1.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -3555,7 +3555,7 @@ created for every test class.
35553555
.. nonce: kfV0wm
35563556
.. section: Library
35573557
3558-
Fix PEP 3118 format strings on ctypes objects with a nontrivial shape.
3558+
Fix :pep:`3118` format strings on ctypes objects with a nontrivial shape.
35593559

35603560
..
35613561
@@ -4824,7 +4824,7 @@ tests.
48244824
.. nonce: kqetng
48254825
.. section: IDLE
48264826
4827-
Change default paragraph width to 72, the PEP 8 recommendation.
4827+
Change default paragraph width to 72, the :pep:`8` recommendation.
48284828

48294829
..
48304830
@@ -5759,7 +5759,7 @@ Add support for ``yield from`` to 2to3.
57595759
.. nonce: dpFbyZ
57605760
.. section: Tools/Demos
57615761
5762-
Add support for the PEP 465 matrix multiplication operator to 2to3.
5762+
Add support for the :pep:`465` matrix multiplication operator to 2to3.
57635763

57645764
..
57655765

Misc/NEWS.d/3.5.0a2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ previous exception.
1515
.. nonce: Ks6_2x
1616
.. section: Library
1717
18-
New os.scandir() function, part of the PEP 471: "os.scandir() function -- a
18+
New os.scandir() function, part of the :pep:`471`: "os.scandir() function -- a
1919
better and faster directory iterator". Patch written by Ben Hoyt.
2020

2121
..
@@ -393,7 +393,7 @@ attribute.
393393
.. nonce: qBauCy
394394
.. section: Windows
395395
396-
Implement PEP 486 - Make the Python Launcher aware of virtual environments.
396+
Implement :pep:`486` - Make the Python Launcher aware of virtual environments.
397397
Patch by Paul Moore.
398398

399399
..

Misc/NEWS.d/3.5.0a4.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include the
88
architecture triplet in the extension name, to make it easy to test builds
99
for different ABIs in the same working tree. Under OS X, the extension name
10-
now includes PEP 3149-style information.
10+
now includes :pep:`3149`-style information.
1111

1212
..
1313
@@ -26,7 +26,7 @@ Joe Jevnik.
2626
.. nonce: FOXb37
2727
.. section: Core and Builtins
2828
29-
Implement PEP 488: removal of .pyo files.
29+
Implement :pep:`488`: removal of .pyo files.
3030

3131
..
3232
@@ -495,7 +495,7 @@ modules already mapped with full name mapping.
495495
496496
select.select() is now retried automatically with the recomputed timeout
497497
when interrupted by a signal, except if the signal handler raises an
498-
exception. This change is part of the PEP 475.
498+
exception. This change is part of the :pep:`475`.
499499

500500
..
501501

Misc/NEWS.d/3.5.0b2.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Fix a crash in the StreamWriter.reset() of CJK codecs.
6262
.. nonce: M2rJNs
6363
.. section: Library
6464
65-
Add math.isclose() and cmath.isclose() functions as per PEP 485. Contributed
65+
Add math.isclose() and cmath.isclose() functions as per :pep:`485`. Contributed
6666
by Chris Barker and Tal Einat.
6767

6868
..

Misc/NEWS.d/3.5.0b3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Add Py_tp_finalize slot for the stable ABI.
3333
.. nonce: 2mNeD8
3434
.. section: Core and Builtins
3535
36-
Introduce a distinct type for PEP 492 coroutines; add types.CoroutineType,
36+
Introduce a distinct type for :pep:`492` coroutines; add types.CoroutineType,
3737
inspect.getcoroutinestate, inspect.getcoroutinelocals; coroutines no longer
3838
use CO_GENERATOR flag; sys.set_coroutine_wrapper works only for 'async def'
3939
coroutines; inspect.iscoroutine no longer uses collections.abc.Coroutine,

Misc/NEWS.d/3.5.0b4.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ argument on Linux.
1414
.. nonce: bqh6PQ
1515
.. section: Core and Builtins
1616
17-
Make PEP 448 dictionary evaluation more consistent.
17+
Make :pep:`448` dictionary evaluation more consistent.
1818

1919
..
2020

Misc/NEWS.d/3.5.0rc3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Prevent __class__ assignment to immutable built-in objects.
2323
.. nonce: 2gLdfN
2424
.. section: Core and Builtins
2525
26-
Fix AST compilation for PEP 448 syntax.
26+
Fix AST compilation for :pep:`448` syntax.
2727

2828
..
2929

0 commit comments

Comments
 (0)