Python Implementations
Python’s official website defines an implementation as follows:
An implementation of Python should be taken to mean a program or environment which provides support for the execution of programs written in the Python language
According to this definition, a Python implementation is either a computer program or an environment, that permits to execute Python code:
- If it is a computer program then it is the Python interpreter.
- If it is an environment then it is the Python interpreter plus the libraries and frameworks that this interpreter can use. Examples of libraries and frameworks are: the Python Standard Library, the Java Standard Library, and the .NET Framework.
A Python implementation implements the principles and specifications of the Python programming language, hence the name implementation. There are multiple Python implementations and all of them implement the same language, Python, but execute Python code in different ways. The most popular implementations are: CPython, Jython, IronPython, and PyPy.
CPython
CPython is the reference implementation of Python and the most commonly used one. It is also the most up-to-date implementation, which means that when a new version of the Python language is released, the first implementation that will implement it is CPython. The other implementations are always behind. For example, the latest versions of Jython and IronPython implement the version 2.7 of the Python language, which is an old version.
CPython is commonly known as Python, however, a distinction must be made between them because Python is a programming language whereas CPython is an implementation of it.
The interpreter of CPython is written in the C programming language, hence the name CPython (i.e. C + Python).
Note 1: The Python interpreter and the Python implementation we have been working with so far are respectively the CPython interpreter and the CPython implementation.
Note 2: CPython is also called the standard implementation, or the default implementation.
Jython
Jython, formerly known as JPython, is an implementation of Python written in the Java programming language and designed for the Java platform. The Jython interpreter allows Python code to use the classes of the Java Standard Library.
IronPython
IronPython is an implementation of Python written in the C# programming language and designed mainly for the .NET Framework. The IronPython interpreter allows Python code to use the .NET libraries and frameworks.
PyPy
PyPy is an implementation of Python written in Python, or more precisely, in Restricted Python (RPython) which is a subset of the Python language. The name “PyPy” is an abbreviation of Python in Python. PyPy main benefit is its increased speed compared to CPython. In fact, the PyPy interpreter runs faster than the CPython interpreter in most cases.
Note: The Python interpreter can be written in many other languages, not just the languages listed above.