Skip to content

Commit 2e1d180

Browse files
committed
Address Victor's nits
1 parent 3d3f5d3 commit 2e1d180

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Doc/using/cmdline.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,11 @@ Miscellaneous options
553553
container system. See also :envvar:`PYTHON_CPU_COUNT`.
554554
If *n* is ``default``, nothing is overridden.
555555
* :samp:`-X presite={package.module}` specifies a module that should be
556-
imported before ``site.py`` is executed and before the :mod:`__main__`
557-
module exists. Therefore, the imported module isn't :mod:`__main__`.
558-
Python needs to be :ref:`built in debug mode <debug-build>` for this
559-
option to exist. See also :envvar:`PYTHON_PRESITE`.
556+
imported before the :mod:`site` module is executed and before the
557+
:mod:`__main__` module exists. Therefore, the imported module isn't
558+
:mod:`__main__`. This can be used to execute code early during Python
559+
initialization. Python needs to be :ref:`built in debug mode <debug-build>`
560+
for this option to exist. See also :envvar:`PYTHON_PRESITE`.
560561

561562
It also allows passing arbitrary values and retrieving them through the
562563
:data:`sys._xoptions` dictionary.
@@ -1113,9 +1114,14 @@ Debug-mode variables
11131114
.. envvar:: PYTHON_PRESITE
11141115

11151116
If this variable is set to a module, that module will be imported
1116-
early in the interpreter lifecycle, before ``site.py`` is executed,
1117-
and before the :mod:`__main__` module is created. Therefore, the
1118-
imported module is not treated as :mod:`__main__`.
1117+
early in the interpreter lifecycle, before the :mod:`site` module is
1118+
executed, and before the :mod:`__main__` module is created.
1119+
Therefore, the imported module is not treated as :mod:`__main__`.
1120+
1121+
This can be used to execute code early during Python initialization.
1122+
1123+
To import a submodule, use ``package.module`` as the value, like in
1124+
an import statement.
11191125

11201126
See also the :option:`-X presite <-X>` command-line option,
11211127
which takes precedence over this variable.

0 commit comments

Comments
 (0)