Pierre GM
Pierre GM

Reputation: 20339

No default bytecode compilation of Python code on Windows?

I just ran into this SO question and I'm baffled. I'd say I have a fair experience with Python, but only on *nux(-like) OSes and I thought bytecode compilation was a given.

I'm obviously missing something here: was something happening behind the curtain I didn't know about on my OSes, like some configuration defaults ? Is it only on Windows and then, why? Is there any reason why not to compile to bytecode?

Thanks a lot in advance for any opinion, I'm very curious.

Upvotes: 1

Views: 1794

Answers (1)

Matthew Trevor
Matthew Trevor

Reputation: 14961

Basically, it's offering to pre-compile the Python installation files to bytecode, which would normally happen the first time they're used. As I understand it, it's just intended as a general convenience to avoid that initial compilation on use.

It would potentially save space not compiling all of the files in the standard library, but that would last only as long as you didn't try to use them.

Upvotes: 4

Related Questions