Is python a interpreted or compiled language?

Chris Angelico rosuav at gmail.com
Wed Jun 20 21:27:02 EDT 2012


On Thu, Jun 21, 2012 at 10:53 AM, Dave Angel <d at davea.name> wrote:
> With java, one has to explicitly compile the java code, while with
> CPython, the runtime logic compiles imported modules if they're not
> already compiled.

Putting it another way:

Java's bytecode and source code are two distinct languages, both well
documented and separately usable (and with their own distinct
limitations - there are things you can do in Java bytecode that you
cannot do in Java source). With CPython, the bytecode is an
implementation detail and an optimization (once it's parsed your .py
file once, a .pyc file can be saved to allow the interpreter to save
some effort next time).

ChrisA



More information about the Python-list mailing list