31

I'm installing Python 3.2 32bit on Win7 machine, there is the following option:

Compile .py Files to Byte Code after Installation

Should I leave option unchecked or is the compilation recommended?

6
  • probably dont want to .. .at least if you want to beable to look at the source later.. Commented Sep 11, 2012 at 19:06
  • 5
    @Joran: The act of compilation does not remove the source. Commented Sep 11, 2012 at 19:09
  • it doesnt make the pyc files? I must have been mistaken thanks for clarifying @IgnacioVazquez-Abrams Commented Sep 11, 2012 at 20:16
  • 2
    It generates the .pyc (and .pyo) files, but it does not remove the .py files. Commented Sep 11, 2012 at 20:34
  • @JoranBeasley why wouldn't you be able to look at the source again?
    – Bbvarghe
    Commented Jul 23, 2013 at 6:45

1 Answer 1

34

Since the bytecode is unlikely to change regardless of how many times it is compiled, the interpreter can take advantage of the small speedup gain. Unless you are very short of hard drive space, you should select this option.

3
  • I always assumed having they must be significant enought to warrant the interpreter going to the trouble of writing them and then checking for and possibly using them later.
    – martineau
    Commented Sep 11, 2012 at 22:18
  • I suppose it does at least prove that the compiler works on the processor... Never hurts to know on exotic boxes.
    – twobob
    Commented Jan 20, 2016 at 1:25
  • tho' if you want (for some strange reason) to use this (as far as I understand internal Python) code in other versions, you should not choose this option due to optimization of byte code compilation (in future versions) and slightly different byte code generation generally between some versions, which can lead to ineffective interpretation, or maybe inability to run
    – 0dminnimda
    Commented Jun 3, 2021 at 18:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.