bpo-17232: Clarify docs for -O and -OO command line options (#5839) · pythoncapi/cpython@186b606 · GitHub
Skip to content

Commit 186b606

Browse files
csabellaterryjreedy
authored andcommitted
bpo-17232: Clarify docs for -O and -OO command line options (python#5839)
The 'optimization' is for space in the executable file, not for run time.
1 parent 6cdb795 commit 186b606

4 files changed

Lines changed: 23 additions & 6 deletions

File tree

Doc/using/cmdline.rst

Lines changed: 13 additions & 2 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify docs for -O and -OO. Patch by Terry Reedy.

Misc/python.man

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,13 @@ for the named module and runs the corresponding
164164
file as a script.
165165
.TP
166166
.B \-O
167-
Turn on basic optimizations. Given twice, causes docstrings to be discarded.
167+
Remove assert statements and any code conditional on the value of
168+
__debug__; augment the filename for compiled (bytecode) files by
169+
adding .opt-1 before the .pyc extension.
168170
.TP
169171
.B \-OO
170-
Discard docstrings in addition to the \fB-O\fP optimizations.
172+
Do \fB-O\fP and also discard docstrings; change the filename for
173+
compiled (bytecode) files by adding .opt-2 before the .pyc extension.
171174
.TP
172175
.B \-q
173176
Do not print the version and copyright messages. These messages are

Modules/main.c

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)