Skip to content

Commit 4c4ef50

Browse files
GH-83893: Cross reference env. vars and -X command line options (GH-103414)
(cherry picked from commit d65ed69) Co-authored-by: Furkan Onder <[email protected]> Co-authored-by: Erlend E. Aasland
1 parent 9f3f109 commit 4c4ef50

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Doc/using/cmdline.rst

+12-6
Original file line numberDiff line numberDiff line change
@@ -492,16 +492,18 @@ Miscellaneous options
492492
Reserved for various implementation-specific options. CPython currently
493493
defines the following possible values:
494494

495-
* ``-X faulthandler`` to enable :mod:`faulthandler`;
495+
* ``-X faulthandler`` to enable :mod:`faulthandler`.
496+
See also :envvar:`PYTHONFAULTHANDLER`.
496497
* ``-X showrefcount`` to output the total reference count and number of used
497498
memory blocks when the program finishes or after each statement in the
498499
interactive interpreter. This only works on :ref:`debug builds
499500
<debug-build>`.
500501
* ``-X tracemalloc`` to start tracing Python memory allocations using the
501502
:mod:`tracemalloc` module. By default, only the most recent frame is
502503
stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start
503-
tracing with a traceback limit of *NFRAME* frames. See the
504-
:func:`tracemalloc.start` for more information.
504+
tracing with a traceback limit of *NFRAME* frames.
505+
See :func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC`
506+
for more information.
505507
* ``-X int_max_str_digits`` configures the :ref:`integer string conversion
506508
length limitation <int_max_str_digits>`. See also
507509
:envvar:`PYTHONINTMAXSTRDIGITS`.
@@ -516,6 +518,7 @@ Miscellaneous options
516518
* ``-X utf8`` enables the :ref:`Python UTF-8 Mode <utf8-mode>`.
517519
``-X utf8=0`` explicitly disables :ref:`Python UTF-8 Mode <utf8-mode>`
518520
(even when it would otherwise activate automatically).
521+
See also :envvar:`PYTHONUTF8`.
519522
* ``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel
520523
tree rooted at the given directory instead of to the code tree. See also
521524
:envvar:`PYTHONPYCACHEPREFIX`.
@@ -847,16 +850,18 @@ conflict.
847850
Python memory allocations using the :mod:`tracemalloc` module. The value of
848851
the variable is the maximum number of frames stored in a traceback of a
849852
trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent
850-
frame. See the :func:`tracemalloc.start` for more information.
853+
frame.
854+
See the :func:`tracemalloc.start` function for more information.
855+
This is equivalent to setting the :option:`-X` ``tracemalloc`` option.
851856

852857
.. versionadded:: 3.4
853858

854859

855860
.. envvar:: PYTHONPROFILEIMPORTTIME
856861

857862
If this environment variable is set to a non-empty string, Python will
858-
show how long each import takes. This is exactly equivalent to setting
859-
``-X importtime`` on the command line.
863+
show how long each import takes.
864+
This is equivalent to setting the :option:`-X` ``importtime`` option.
860865

861866
.. versionadded:: 3.7
862867

@@ -998,6 +1003,7 @@ conflict.
9981003
If this environment variable is set to a non-empty string, enable
9991004
:ref:`Python Development Mode <devmode>`, introducing additional runtime
10001005
checks that are too expensive to be enabled by default.
1006+
This is equivalent to setting the :option:`-X` ``dev`` option.
10011007

10021008
.. versionadded:: 3.7
10031009

0 commit comments

Comments
 (0)