From 642e1c2a0ebbe4f66e92efbf69d69a956f0ec832 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 28 Feb 2020 10:52:54 +0100 Subject: [PATCH] bpo-39712: Add doc refs for env. vars & -X options Mention corresponding environment variables in -X option documentation. Also reference -X options in environment variable documentation. --- Doc/using/cmdline.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 2206e5065b..e5980f293a 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -425,15 +425,17 @@ Miscellaneous options Reserved for various implementation-specific options. CPython currently defines the following possible values: - * ``-X faulthandler`` to enable :mod:`faulthandler`; + * ``-X faulthandler`` to enable :mod:`faulthandler`. See also + :envvar:`PYTHONFAULTHANDLER`. * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on debug builds. * ``-X tracemalloc`` to start tracing Python memory allocations using the :mod:`tracemalloc` module. By default, only the most recent frame is stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start - tracing with a traceback limit of *NFRAME* frames. See the - :func:`tracemalloc.start` for more information. + tracing with a traceback limit of *NFRAME* frames. See + :func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC` for more + information. * ``-X importtime`` to show how long each import takes. It shows module name, cumulative time (including nested imports) and self time (excluding nested imports). Note that its output may be broken in multi-threaded @@ -441,7 +443,7 @@ Miscellaneous options asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`. * ``-X dev``: enable :ref:`Python Development Mode `, introducing additional runtime checks that are too expensive to be enabled by - default. + default. See also :envvar:`PYTHONDEVMODE`. * ``-X utf8`` enables UTF-8 mode for operating system interfaces, overriding the default locale-aware mode. ``-X utf8=0`` explicitly disables UTF-8 mode (even when it would otherwise activate automatically). @@ -723,7 +725,8 @@ conflict. Python memory allocations using the :mod:`tracemalloc` module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent - frame. See the :func:`tracemalloc.start` for more information. + frame. See the :func:`tracemalloc.start` for more information. See also + command line option :option:`-X` ``tracemalloc``. .. versionadded:: 3.4 @@ -876,7 +879,8 @@ conflict. If this environment variable is set to a non-empty string, enable :ref:`Python Development Mode `, introducing additional runtime - checks that are too expensive to be enabled by default. + checks that are too expensive to be enabled by default. See also command + line option :option:`-X` ``dev``. .. versionadded:: 3.7 -- 2.22.0