Skip to content

Commit 624857e

Browse files
gh-144329: Fix cross-reference label for finding-modules
1 parent ba7dd6b commit 624857e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Doc/library/site.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,21 @@ with ``import`` (followed by space or tab) are executed.
8282
On Windows, a file whose name has the form :file:`._pth` is handled
8383
differently; it is used by the Windows-only "embeddable distribution"
8484
to provide a self-contained Python environment. See
85-
:ref:`finding_modules` for more details.
85+
:ref:`finding-modules` for more details.
8686

8787
.. note::
8888

8989
An executable line in a :file:`.pth` file is run at every Python startup,
9090
regardless of whether a particular module is actually going to be used.
9191
Its impact should thus be kept to a minimum.
92-
92+
The primary intended purpose of executable lines is to make the
93+
corresponding module(s) importable
94+
(load 3rd-party import hooks, adjust :envvar:`PATH` etc).
95+
Any other initialization is supposed to be done upon a module's
96+
actual import, if and when it happens.
97+
Limiting a code chunk to a single line is a deliberate measure
98+
to discourage putting anything more complex here.
99+
93100
.. versionchanged:: 3.13
94101
The :file:`.pth` files are now decoded by UTF-8 at first and then by the
95102
:term:`locale encoding` if it fails.
@@ -306,5 +313,4 @@ value greater than 2 if there is an error.
306313
.. seealso::
307314

308315
* :pep:`370` -- Per user site-packages directory
309-
* :ref:`sys-path-init` -- The initialization of :data:`sys.path`.
310-
316+
* :ref:`sys-path-init` -- The initialization of :data:`sys.path`.

0 commit comments

Comments
 (0)