Skip to content

Commit

Permalink
PEP 657: Clarifications regarding optimized mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed May 8, 2021
1 parent 8227557 commit 2be673e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pep-0657.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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``.
Expand Down

0 comments on commit 2be673e

Please sign in to comment.