diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -210,14 +210,15 @@ .. cmdoption:: -O - Turn on basic optimizations. This changes the filename extension for - compiled (:term:`bytecode`) files from ``.pyc`` to ``.pyo``. See also - :envvar:`PYTHONOPTIMIZE`. + Remove assert statements and any code conditional on the value of + :const:`__debug__`. Change the filename extension for compiled + (:term:`bytecode`) files from ``.pyc`` to ``.pyo``. + See also :envvar:`PYTHONOPTIMIZE`. .. cmdoption:: -OO - Discard docstrings in addition to the :option:`-O` optimizations. + Discard docstrings in addition to what :option:`-O` does. .. cmdoption:: -q diff --git a/Modules/main.c b/Modules/main.c --- a/Modules/main.c +++ b/Modules/main.c @@ -66,8 +66,9 @@ -i : inspect interactively after running script; forces a prompt even\n\ if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\ -m mod : run library module as a script (terminates option list)\n\ --O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\ --OO : remove doc-strings in addition to the -O optimizations\n\ +-O : remove assert and __debug__-dependent statements; change .py\n\ + to .pyo; also PYTHONOPTIMIZE=x\n\ +-OO : remove doc-strings in addition to the -O changes\n\ -q : don't print version and copyright messages on interactive startup\n\ -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\ -S : don't imply 'import site' on initialization\n\