diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-02-25 03:46:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-25 03:46:16 (GMT) |
commit | fc9471a888f373aedff3c118ae9a6cbf2037bd7c (patch) | |
tree | 2a20a22f87d40c43fffed19c37e9754cb77f3cad /Doc | |
parent | aab225840360719516eca55a7a69cfee45aee2af (diff) | |
download | cpython-fc9471a888f373aedff3c118ae9a6cbf2037bd7c.zip cpython-fc9471a888f373aedff3c118ae9a6cbf2037bd7c.tar.gz cpython-fc9471a888f373aedff3c118ae9a6cbf2037bd7c.tar.bz2 |
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
The 'optimization' is for space in the executable file, not for run time.
(cherry picked from commit 186b606d8a2ea4fd51b7286813302c8e8c7006cc)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/using/cmdline.rst | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 9ffb714..8463ad9 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -246,12 +246,23 @@ Miscellaneous options .. cmdoption:: -O - Turn on basic optimizations. See also :envvar:`PYTHONOPTIMIZE`. + Remove assert statements and any code conditional on the value of + :const:`__debug__`. Augment the filename for compiled + (:term:`bytecode`) files by adding ``.opt-1`` before the ``.pyc`` + extension (see :pep:`488`). See also :envvar:`PYTHONOPTIMIZE`. + + .. versionchanged:: 3.5 + Modify ``.pyc`` filenames according to :pep:`488`. .. cmdoption:: -OO - Discard docstrings in addition to the :option:`-O` optimizations. + Do :option:`-O` and also discard docstrings. Augment the filename + for compiled (:term:`bytecode`) files by adding ``.opt-2`` before the + ``.pyc`` extension (see :pep:`488`). + + .. versionchanged:: 3.5 + Modify ``.pyc`` filenames according to :pep:`488`. .. cmdoption:: -q |