Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Doc/tutorial/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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 and spam.cpython-33.pyc; I think it would be better to work the term source there.

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.
Copy link
Member

Choose a reason for hiding this comment

The 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:

Expand Down