the --check-hash-based-pycs option

This commit is contained in:
Benjamin Peterson 2017-09-15 15:22:41 -07:00
parent 832453cfda
commit 67602a3a5b
1 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,15 @@ taking values ``timestamp`` (the default), ``checked-hash``, and
``importlib`` will be extended with a ``source_hash(source)`` function that ``importlib`` will be extended with a ``source_hash(source)`` function that
computes the hash used by the pyc writing code for a bytestring **source**. computes the hash used by the pyc writing code for a bytestring **source**.
Runtime configuration of hash-based pyc invalidation will be facilitated by a
new ``--check-hash-based-pycs`` interpreter option. This is a tristate option,
which may take 3 values: ``default``, ``always``, and ``never``. The default
value, ``default``, means the ``check_source`` flag in hash-based pycs
determines invalidation as described above. ``always`` causes the interpreter to
hash the source file for invalidation regardless of value of ``check_source``
bit. ``never`` causes the interpreter to always assume hash-based pycs are
valid. Timestamp-based pycs are unaffected by this option.
References References
========== ==========