Python is a language, not an implementation. Python can be run as a scripting language internally to let your users script your application. Python can also be the main programming language that you use to write your entire application. The implementation of the language being the target platform for the language and not the language itself. Python is not directly compiled into a machine language, it is compiled into a byte code language that is either interpreted or further compiled into a machine language before it is run. Cython is compiled into C and then further compiled into a machine language before ever being run. Pypy compiles hot spots into machine language for optimized sections of code. Cpython interprets compiled byte code similar to CLR or JVM without the hot spot to machine language jit compilation that speeds up pypy, java, c# etc..
Here is a good quote from stack overflow on the topic http://stackoverflow.com/questions/2998215/if-python-is-interpreted-what-are-pyc-files
There is no such thing as an interpreted language. Whether an interpreter or a compiler is used is purely a trait of the implementation and has absolutely nothing whatsoever to do with the language.
A language is just a set of abstract mathematical rules. An interpreter is one of several concrete implementation strategies for a language. Those two live on completely different abstraction levels. If English were a typed language, the term “interpreted language” would be a type error. The statement “Python is an interpreted language” is not just false (because being false would imply that the statement even makes sense, even if it is wrong), it just plain doesn’t make sense, because a language can neverbe interpreted.
In particular, if you look at the currently existing Python implementations, these are the implementation strategies they are using:
- IronPython: compiles to DLR trees which the DLR then compiles to CIL bytecode. What happens to the CIL bytecode depends upon which CLI VES you are running on, but Microsoft .NET, GNU Portable.NET and Novell Mono will eventually compile it to native machine code.
- Jython: interprets Python sourcecode until it identifies the hot code paths, which it then compiles to JVML bytecode. What happens to the JVML bytecode depends upon which JVM you are running on. Maxine will directly compile it to un-optimized native code until it identifies the hot code paths, which it then recompiles to optimized native code. HotSpot will first interpret the JVML bytecode and then eventually compile the hot code paths to optimized machine code.
- PyPy: compiles to PyPy bytecode, which then gets interpreted by the PyPy VM until it identifies the hot code paths which it then compiles into native code, JVML bytecode or CIL bytecode depending on which platform you are running on.
- CPython: compiles to CPython bytecode which it then interprets.
- Stackless Python: compiles to CPython bytecode which it then interprets.
- Unladen Swallow: compiles to CPython bytecode which it then interprets until it identifies the hot code paths which it then compiles to LLVM IR which the LLVM compiler then compiles to native machine code.
You might notice that every single one of the implementations in that list (plus some others I didn’t mention, like tinypy, Shedskin or Psyco) has a compiler. In fact, as far as I know, there is currently no Python implementation which is purely interpreted, there is no such implementation planned and there never has been such an implementation.
Not only does the term “interpreted language” not make sense, even if you interpret it as meaning “language with interpreted implementation”, it is clearly not true. Whoever told you that, obviously doesn’t know what he is talking about.