◐ Shell
clean mode source ↗

bpo-2506: Add -X noopt command line option by vstinner · Pull Request #13600 · python/cpython

merwok

merwok

tirkarthi

asvetlov

@vstinner vstinner changed the title bpo-2506: Add -X noopt command line option [WIP] bpo-2506: Add -X noopt command line option

May 29, 2019

serhiy-storchaka

@vstinner vstinner changed the title [WIP] bpo-2506: Add -X noopt command line option bpo-2506: Add -X noopt command line option

Aug 20, 2019
Add -X noopt command line option to disable compiler optimizations.

distutils ignores noopt: always enable compiler optimizations.

* Add sys.flags.noopt flag.
* Add 'noopt' keyword-only parameter to
  builtin compile(), importlib.util.cache_from_source() and
  py_compile.compile().
* importlib: SourceLoader gets an additional keyword-only '_noopt'
  parameter. It is used by py_compile.compile().
* importlib uses ``.noopt.pyc`` suffix for .pyc files
  if sys.flags.noopt is true.
* Add PyConfig.optimize parameter.
* compiler: rename c_optimize to c_optimization_level,
  add c_optimize.
* Update subprocess._optim_args_from_interpreter_flags().
* Add support.requires_compiler_optimizations()
* Update unit tests which rely on compiler optimizations for noopt:
  add @support.requires_compiler_optimizations.
* Add _PyAST_Compile() and _Py_CompileString() private functions:
  they have an additional 'noopt' parameter.
* Set _Py_CONFIG_VERSION to 2

Co-Authored-By: Yury Selivanov <yury@magic.io>