diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-02-23 20:48:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-23 20:48:27 (GMT) |
commit | 13951c7f25c628ea2dc0a869ebe18e7bf593fa6d (patch) | |
tree | a2fa42d453cfad82a5fad5015bbe69fe153eec04 /Python | |
parent | c6ecd9c14081a787959e13df33e250102a658154 (diff) | |
download | cpython-13951c7f25c628ea2dc0a869ebe18e7bf593fa6d.zip cpython-13951c7f25c628ea2dc0a869ebe18e7bf593fa6d.tar.gz cpython-13951c7f25c628ea2dc0a869ebe18e7bf593fa6d.tar.bz2 |
[3.8] bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131) (GH-18133)
https://bugs.python.org/issue39427
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 41f0ef6abbd304409c55612a08788cdd59fbc8a3)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/initconfig.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c index a30fdd1..a0b2691 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -63,7 +63,38 @@ static const char usage_3[] = "\ -W arg : warning control; arg is action:message:category:module:lineno\n\ also PYTHONWARNINGS=arg\n\ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ --X opt : set implementation-specific option\n\ +-X opt : set implementation-specific option. The following options are available:\n\ +\n\ + -X faulthandler: enable faulthandler\n\ + -X showrefcount: output the total reference count and number of used\n\ + memory blocks when the program finishes or after each statement in the\n\ + interactive interpreter. This only works on debug builds\n\ + -X tracemalloc: start tracing Python memory allocations using the\n\ + tracemalloc module. By default, only the most recent frame is stored in a\n\ + traceback of a trace. Use -X tracemalloc=NFRAME to start tracing with a\n\ + traceback limit of NFRAME frames\n\ + -X showalloccount: output the total count of allocated objects for each\n\ + type when the program finishes. This only works when Python was built with\n\ + COUNT_ALLOCS defined\n\ + -X importtime: show how long each import takes. It shows module name,\n\ + cumulative time (including nested imports) and self time (excluding\n\ + nested imports). Note that its output may be broken in multi-threaded\n\ + application. Typical usage is python3 -X importtime -c 'import asyncio'\n\ + -X dev: enable CPython’s “development mode”, introducing additional runtime\n\ + checks which are too expensive to be enabled by default. Effect of the\n\ + developer mode:\n\ + * Add default warning filter, as -W default\n\ + * Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks() C function\n\ + * Enable the faulthandler module to dump the Python traceback on a crash\n\ + * Enable asyncio debug mode\n\ + * Set the dev_mode attribute of sys.flags to True\n\ + * io.IOBase destructor logs close() exceptions\n\ + -X utf8: enable UTF-8 mode for operating system interfaces, overriding the default\n\ + locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode (even when it would\n\ + otherwise activate automatically)\n\ + -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\ + given directory instead of to the code tree\n\ +\n\ --check-hash-based-pycs always|default|never:\n\ control how Python invalidates hash-based .pyc files\n\ "; |