-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-93378: make obvious the distinction between source vs. compiled module #93711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,17 +225,18 @@ version of spam.py would be cached as ``__pycache__/spam.cpython-33.pyc``. This | |
naming convention allows compiled modules from different releases and different | ||
versions of Python to coexist. | ||
|
||
Python checks the modification date of the source against the compiled version | ||
to see if it's out of date and needs to be recompiled. This is a completely | ||
automatic process. Also, the compiled modules are platform-independent, so the | ||
same library can be shared among systems with different architectures. | ||
Python checks the modification date of the source (``.py``) against the compiled | ||
(``.pyc``) version to see if it's out of date and needs to be recompiled. This | ||
is a completely automatic process. Also, the compiled modules are | ||
platform-independent, so the same library can be shared among systems with | ||
different architectures. | ||
|
||
Python does not check the cache in two circumstances. First, it always | ||
recompiles and does not store the result for the module that's loaded directly | ||
from the command line. Second, it does not check the cache if there is no | ||
source module. To support a non-source (compiled only) distribution, the | ||
compiled module must be in the source directory, and there must not be a source | ||
module. | ||
corresponding source module. To support a non-source (compiled only) | ||
distribution, the compiled module must be in the source directory, and there | ||
must not be a source module. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines were not changed but appear changed. To keep the history useful, please avoid rewrapping paragraphs. It’s fine if one line is a little too long, or quite short, this doesn’t impact the rendered output. |
||
|
||
Some tips for experts: | ||
|
||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 223-224 just above have an example of
spam.py
andspam.cpython-33.pyc
; I think it would be better to work the term source there.