PEP 657: Clarifications regarding optimized mode

This commit is contained in:
Pablo Galindo 2021-05-08 19:58:01 +01:00
parent 822755724f
commit 2be673e54a
No known key found for this signature in database
GPG Key ID: FFE87404168BD847
1 changed files with 6 additions and 6 deletions

View File

@ -167,8 +167,8 @@ the program.
We understand that the extra cost of this information may not be acceptable for
some users, so we propose an opt-out mechanism when Python is executed in
optimized mode (``python -O``), which will cause pyo files to not include the
extra information.
"opt-2" optimized mode (``python -OO``), which will cause pyc files to not include
the extra information.
Specification
@ -299,15 +299,15 @@ Opt-out mechanism
To offer an opt-out mechanism for those users that care about the storage and
memory overhead, the functionality will be deactivated along with the extra
information when Python is executed in optimized mode (``python -O``) resulting
in ``pyo`` files not having the overhead associated with the extra required
data.
information when Python is executed in "opt-2" optimized mode (``python -OO``)
resulting in ``pyc`` files not having the overhead associated with the extra
required data.
To allow third party tools and other programs that are currently parsing
tracebacks to catch up and to allow users to deactivate the new feature, the
following methods will be provided to deactivate displaying the new highlight
carets (but not to avoid to storing the data, users will need to use Python in
optimized mode for that):
"opt-2" optimized mode for that):
* A new environment variable: ``PY_DEACTIVATE_TRACEBACK_RANGES``
* A new command line option for the dev mode: ``python -Xnotracebackranges``.