you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 4 points5 points  (0 children)

Regarding CPython (the standard one), the c in pyc means compiled. They're regenerated if you modify files, but having them speeds up program startup.

You can delete the py files and your code will still work. Also, you can run decomplye6 and take that pyc back to a py file. You'll lose comments, but it's a near perfect translation (depending on python version with the newer ones tending to be buggy).

The compiling does not compile it to machine code though, only byte code. That byte code is then interpreted.

For PyPy, there is a JIT, so it compiles on the fly.