bpo-17232: Clarify docs for -O and -OO command line options#5839
Conversation
| -OO : remove doc-strings in addition to the -O optimizations\n\ | ||
| -O : remove assert and __debug__-dependent statements; add .opt1 before\n\ | ||
| .pyc extension; also PYTHONOPTIMIZE=x\n\ | ||
| -OO : do -O changes and also discard docstrings; add .opt2 before\n\ |
There was a problem hiding this comment.
Why do these say “.opt1” etc without a dash, but the other cases have a dash in “.opt-1” etc?
There was a problem hiding this comment.
I presume oversight on Cheryl's part. I will fix.
There was a problem hiding this comment.
I presume oversight. I checked my cache and '-' is correct.
There was a problem hiding this comment.
Yes, thank you for noticing that, Martin, and thank you, Terry, for fixing it. It was an oversight.
| -OO : remove doc-strings in addition to the -O optimizations\n\ | ||
| -O : remove assert and __debug__-dependent statements; add .opt1 before\n\ | ||
| .pyc extension; also PYTHONOPTIMIZE=x\n\ | ||
| -OO : do -O changes and also discard docstrings; add .opt2 before\n\ |
There was a problem hiding this comment.
I presume oversight on Cheryl's part. I will fix.
| Turn on basic optimizations. 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 to include ``.opt-1`` before the ``.pyc`` |
There was a problem hiding this comment.
I will change these to read 'Augment the filename for compiled bytecode files by adding .opt-1 before the .pyc extension. ' It does not matter whether one thinks of the addition as a 2nd extension or not, and the change is strictly an addition.
| -OO : remove doc-strings in addition to the -O optimizations\n\ | ||
| -O : remove assert and __debug__-dependent statements; add .opt1 before\n\ | ||
| .pyc extension; also PYTHONOPTIMIZE=x\n\ | ||
| -OO : do -O changes and also discard docstrings; add .opt2 before\n\ |
There was a problem hiding this comment.
I presume oversight. I checked my cache and '-' is correct.
| .TP | ||
| .B \-OO | ||
| Discard docstrings in addition to the \fB-O\fP optimizations. | ||
| Do \fB-O\fP and also discard docstrings; change the filename for |
There was a problem hiding this comment.
Cheryl, can you explain the \fB, \fP markup and verify that you somehow tested that it does 'the right thing'? I looked at both the web page and python -h output.
There was a problem hiding this comment.
When I changed the line, I kept that part from the original line and simply add the other text around it. However, it appears the Github does attempt to show what will happen with it. If you click on the 'View' button for this source, Github applies the markup in non-raw mode. This shows up as bolded as does some of the text in the -i and -I option that has similar (though not exactly the same) markup.
There was a problem hiding this comment.
Thanks. Enough to comfortably merge without personal test.
|
@terryjreedy: Please replace |
|
Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
GH-5867 is a backport of this pull request to the 3.7 branch. |
|
GH-5868 is a backport of this pull request to the 3.6 branch. |
Original patch by Terry Reedy.
https://bugs.python.org/issue17232