Skip to content

Commit dae379c

Browse files
authored
PEP 432: Fix footnotes and syntax highlighting (#2716)
1 parent 99c0bda commit dae379c

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

pep-0432.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Requires: 587
1313
Created: 28-Dec-2012
1414
Post-History: 28-Dec-2012, 02-Jan-2013, 30-Mar-2019, 28-Jun-2020
1515

16+
.. highlight:: c
1617

1718
PEP Withdrawal
1819
==============
@@ -151,10 +152,10 @@ Background
151152

152153
Over time, CPython's initialization sequence has become progressively more
153154
complicated, offering more options, as well as performing more complex tasks
154-
(such as configuring the Unicode settings for OS interfaces in Python 3 [10_],
155+
(such as configuring the Unicode settings for OS interfaces in Python 3 [10]_,
155156
bootstrapping a pure Python implementation of the import system, and
156157
implementing an isolated mode more suitable for system applications that run
157-
with elevated privileges [6_]).
158+
with elevated privileges [6]_).
158159

159160
Much of this complexity is formally accessible only through the ``Py_Main``
160161
and ``Py_Initialize`` APIs, offering embedding applications little
@@ -166,9 +167,9 @@ API cannot be used safely.
166167
A number of proposals are on the table for even *more* sophisticated
167168
startup behaviour, such as better control over ``sys.path``
168169
initialization (e.g. easily adding additional directories on the command line
169-
in a cross-platform fashion [7_], controlling the configuration of
170-
``sys.path[0]`` [8_]), easier configuration of utilities like coverage
171-
tracing when launching Python subprocesses [9_]).
170+
in a cross-platform fashion [7]_, controlling the configuration of
171+
``sys.path[0]`` [8]_), easier configuration of utilities like coverage
172+
tracing when launching Python subprocesses [9]_).
172173

173174
Rather than continuing to bolt such behaviour onto an already complicated
174175
system indefinitely, this PEP proposes to start simplifying the status quo by
@@ -195,7 +196,7 @@ The CPython startup sequence as of Python 3.6 was difficult to understand, and
195196
even more difficult to modify. It was not clear what state the interpreter was
196197
in while much of the initialization code executed, leading to behaviour such
197198
as lists, dictionaries and Unicode values being created prior to the call
198-
to ``Py_Initialize`` when the ``-X`` or ``-W`` options are used [1_].
199+
to ``Py_Initialize`` when the ``-X`` or ``-W`` options are used [1]_.
199200

200201
By moving to an explicitly multi-phase startup sequence, developers should
201202
only need to understand:
@@ -238,11 +239,15 @@ should minimise their impact on the startup overhead.
238239
Experience with the importlib migration suggests that the startup time is
239240
dominated by IO operations. However, to monitor the impact of any changes,
240241
a simple benchmark can be used to check how long it takes to start and then
241-
tear down the interpreter::
242+
tear down the interpreter:
243+
244+
.. code-block:: bash
242245

243246
python3 -m timeit -s "from subprocess import call" "call(['./python', '-Sc', 'pass'])"
244247

245-
Current numbers on my system for Python 3.7 (as built by the Fedora project)::
248+
Current numbers on my system for Python 3.7 (as built by the Fedora project):
249+
250+
.. code-block:: shell
246251

247252
$ python3 -m timeit -s "from subprocess import call" "call(['python3', '-Sc', 'pass'])"
248253
50 loops, best of 5: 6.48 msec per loop
@@ -269,7 +274,7 @@ Implementation Strategy
269274
=======================
270275

271276
An initial attempt was made at implementing an earlier version of this PEP for
272-
Python 3.4 [2_], with one of the significant problems encountered being merge
277+
Python 3.4 [2]_, with one of the significant problems encountered being merge
273278
conflicts after the initial structural changes were put in place to start the
274279
refactoring process. Unlike some other previous major changes, such as the
275280
switch to an AST-based compiler in Python 2.5, or the switch to the importlib
@@ -1069,7 +1074,7 @@ aspects are the fact that user site directories are enabled,
10691074
environment variables are trusted and that the directory containing the
10701075
executed file is placed at the beginning of the import path.
10711076

1072-
Issue 16499 [6_] added a ``-I`` option to change the behaviour of
1077+
Issue 16499 [6]_ added a ``-I`` option to change the behaviour of
10731078
the normal CPython executable, but this is a hard to discover solution (and
10741079
adds yet another option to an already complex CLI). This PEP proposes to
10751080
instead add a separate ``system-python`` executable
@@ -1173,7 +1178,7 @@ Locating Python and the standard library
11731178

11741179
The location of the Python binary and the standard library is influenced
11751180
by several elements. The algorithm used to perform the calculation is
1176-
not documented anywhere other than in the source code [3_,4_]. Even that
1181+
not documented anywhere other than in the source code [3]_, [4]_. Even that
11771182
description is incomplete, as it failed to be updated for the virtual
11781183
environment support added in Python 3.3 (detailed in :pep:`405`).
11791184

@@ -1213,7 +1218,7 @@ the ``PYTHONPATH`` environment variable.
12131218

12141219
The ``site`` module, which is implicitly imported at startup (unless
12151220
disabled via the ``-S`` option) adds additional paths to this initial
1216-
set of paths, as described in its documentation [5_].
1221+
set of paths, as described in its documentation [5]_.
12171222

12181223
The ``-s`` command line option can be used to exclude the user site
12191224
directory from the list of directories added. Embedding applications
@@ -1372,7 +1377,7 @@ connection by the operating system.
13721377
TBD: Document how the "-x" option is handled (skips processing of the
13731378
first comment line in the main script)
13741379

1375-
Also see detailed sequence of operations notes at [1_]
1380+
Also see detailed sequence of operations notes at [1]_.
13761381

13771382

13781383
References

0 commit comments

Comments
 (0)