gh-143134: Docs: clarify PYTHONDONTWRITEBYTECODE behavior#143144
Open
Javed-Shekh777 wants to merge 7 commits intopython:mainfrom
Open
gh-143134: Docs: clarify PYTHONDONTWRITEBYTECODE behavior#143144Javed-Shekh777 wants to merge 7 commits intopython:mainfrom
Javed-Shekh777 wants to merge 7 commits intopython:mainfrom
Conversation
StanFromIreland
requested changes
Dec 24, 2025
Member
|
Please revert the title format change. |
…/Javed-Shekh777/cpython into docs-fix-pythondontwritebytecode
Member
StanFromIreland
left a comment
There was a problem hiding this comment.
Also, see Victors list and Serhiy's comment on the issue, there are more to fix.
Comment on lines
+884
to
+885
| ``.pyc`` files on the import of source modules. Setting it to ``0`` does | ||
| not disable bytecode writing. This is equivalent to specifying the |
Member
There was a problem hiding this comment.
Why add "Setting it to 0 does not disable bytecode writing," it is already implied by the first sentence ("other than 0"), no?
Member
There was a problem hiding this comment.
Yeah, I suggest to remove this sentence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes incorrect documentation for
PYTHONDONTWRITEBYTECODE.The documentation previously stated that setting the variable to any
non-empty string disables writing
.pycfiles. In reality, the value isparsed as an integer flag: non-zero values disable bytecode generation,
while setting it to
0does not.This change updates the documentation to accurately reflect the actual
runtime behavior, keeping it consistent with how the variable is handled
in
Python/initconfig.c.Closes #143134
📚 Documentation preview 📚: https://cpython-previews--143144.org.readthedocs.build/