[docs] [issue12982] Document that importing .pyo files needs python -O

Terry J. Reedy report at bugs.python.org
Thu Jun 14 20:59:08 CEST 2012


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Eric, can you find a place in the current doc where -O and .pyo are mentioned, and where you think a sentence should go. What sentence(s) would you like to see.

Other comments:

__debug__ is intended to be a process-global compilation value (implemented as a keyword) set on startup

>>> __debug__
True
>>> __debug__ = False
SyntaxError: assignment to keyword

The devs are not willing to support having contradictory values in the same process. Indeed, since I posted last night, the pydev discussion has moved to the question of whether -O, __debug__, and .pyo as now defined are worth the nuisance they cause or whether some or all should be deprecated. (Docstring stripping for saving space could then be a separate tool.)

---
Python interpreters exist to run Python code. The existence, persistence, and other details of compilation caches are version-dependent implementation details. Being able to execute from such caches without source present is also an implementation detail, and for CPython, it gets secondary support at best. (This is a compromise between full support and no support.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12982>
_______________________________________


More information about the docs mailing list