@@ -500,94 +500,102 @@ Miscellaneous options
500
500
501
501
* ``-X faulthandler `` to enable :mod: `faulthandler `.
502
502
See also :envvar: `PYTHONFAULTHANDLER `.
503
+
504
+ .. versionadded :: 3.3
505
+
503
506
* ``-X showrefcount `` to output the total reference count and number of used
504
507
memory blocks when the program finishes or after each statement in the
505
508
interactive interpreter. This only works on :ref: `debug builds
506
509
<debug-build>`.
510
+
511
+ .. versionadded :: 3.4
512
+
507
513
* ``-X tracemalloc `` to start tracing Python memory allocations using the
508
514
:mod: `tracemalloc ` module. By default, only the most recent frame is
509
515
stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME `` to start
510
516
tracing with a traceback limit of *NFRAME * frames.
511
517
See :func: `tracemalloc.start ` and :envvar: `PYTHONTRACEMALLOC `
512
518
for more information.
519
+
520
+ .. versionadded :: 3.4
521
+
513
522
* ``-X int_max_str_digits `` configures the :ref: `integer string conversion
514
523
length limitation <int_max_str_digits>`. See also
515
524
:envvar: `PYTHONINTMAXSTRDIGITS `.
525
+
526
+ .. versionadded :: 3.11
527
+
516
528
* ``-X importtime `` to show how long each import takes. It shows module
517
529
name, cumulative time (including nested imports) and self time (excluding
518
530
nested imports). Note that its output may be broken in multi-threaded
519
531
application. Typical usage is ``python3 -X importtime -c 'import
520
532
asyncio' ``. See also :envvar: `PYTHONPROFILEIMPORTTIME `.
533
+
534
+ .. versionadded :: 3.7
535
+
521
536
* ``-X dev ``: enable :ref: `Python Development Mode <devmode >`, introducing
522
537
additional runtime checks that are too expensive to be enabled by
523
538
default. See also :envvar: `PYTHONDEVMODE `.
539
+
540
+ .. versionadded :: 3.7
541
+
524
542
* ``-X utf8 `` enables the :ref: `Python UTF-8 Mode <utf8-mode >`.
525
543
``-X utf8=0 `` explicitly disables :ref: `Python UTF-8 Mode <utf8-mode >`
526
544
(even when it would otherwise activate automatically).
527
545
See also :envvar: `PYTHONUTF8 `.
546
+
547
+ .. versionadded :: 3.7
548
+
528
549
* ``-X pycache_prefix=PATH `` enables writing ``.pyc `` files to a parallel
529
550
tree rooted at the given directory instead of to the code tree. See also
530
551
:envvar: `PYTHONPYCACHEPREFIX `.
552
+
553
+ .. versionadded :: 3.8
554
+
531
555
* ``-X warn_default_encoding `` issues a :class: `EncodingWarning ` when the
532
556
locale-specific default encoding is used for opening files.
533
557
See also :envvar: `PYTHONWARNDEFAULTENCODING `.
558
+
559
+ .. versionadded :: 3.10
560
+
534
561
* ``-X no_debug_ranges `` disables the inclusion of the tables mapping extra
535
562
location information (end line, start column offset and end column offset)
536
563
to every instruction in code objects. This is useful when smaller code
537
564
objects and pyc files are desired as well as suppressing the extra visual
538
565
location indicators when the interpreter displays tracebacks. See also
539
566
:envvar: `PYTHONNODEBUGRANGES `.
567
+
568
+ .. versionadded :: 3.11
569
+
540
570
* ``-X frozen_modules `` determines whether or not frozen modules are
541
571
ignored by the import machinery. A value of "on" means they get
542
572
imported and "off" means they are ignored. The default is "on"
543
573
if this is an installed Python (the normal case). If it's under
544
574
development (running from the source tree) then the default is "off".
545
575
Note that the "importlib_bootstrap" and "importlib_bootstrap_external"
546
576
frozen modules are always used, even if this flag is set to "off".
577
+
578
+ .. versionadded :: 3.11
579
+
547
580
* ``-X perf `` enables support for the Linux ``perf `` profiler.
548
581
When this option is provided, the ``perf `` profiler will be able to
549
582
report Python calls. This option is only available on some platforms and
550
583
will do nothing if is not supported on the current system. The default value
551
584
is "off". See also :envvar: `PYTHONPERFSUPPORT ` and :ref: `perf_profiling `.
552
585
586
+ .. versionadded :: 3.12
587
+
553
588
It also allows passing arbitrary values and retrieving them through the
554
589
:data: `sys._xoptions ` dictionary.
555
590
556
591
.. versionadded :: 3.2
557
592
558
- .. versionchanged :: 3.3
559
- Added the ``-X faulthandler `` option.
560
-
561
- .. versionchanged :: 3.4
562
- Added the ``-X showrefcount `` and ``-X tracemalloc `` options.
563
-
564
- .. versionchanged :: 3.6
565
- Added the ``-X showalloccount `` option.
566
-
567
- .. versionchanged :: 3.7
568
- Added the ``-X importtime ``, ``-X dev `` and ``-X utf8 `` options.
569
-
570
- .. versionchanged :: 3.8
571
- Added the ``-X pycache_prefix `` option. The ``-X dev `` option now logs
572
- ``close() `` exceptions in :class: `io.IOBase ` destructor.
573
-
574
593
.. versionchanged :: 3.9
575
- Using ``-X dev `` option, check *encoding * and *errors * arguments on
576
- string encoding and decoding operations.
577
-
578
- The ``-X showalloccount `` option has been removed.
594
+ Removed the ``-X showalloccount `` option.
579
595
580
596
.. versionchanged :: 3.10
581
- Added the ``-X warn_default_encoding `` option.
582
597
Removed the ``-X oldparser `` option.
583
598
584
- .. versionchanged :: 3.11
585
- Added the ``-X no_debug_ranges ``, ``-X frozen_modules `` and
586
- ``-X int_max_str_digits `` options.
587
-
588
- .. versionchanged :: 3.12
589
- Added the ``-X perf `` option.
590
-
591
599
592
600
Options you shouldn't use
593
601
~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments