Skip to content

Commit 8e2a095

Browse files
committed
Added a section on different Python implementations
1 parent 3d1be43 commit 8e2a095

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

docs/starting/which-python.rst

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,68 @@ Which Python to Support?
3030
~~~~~~~~~~~~~~~~~~~~~~~~
3131

3232
If you're starting work on a new Python module, I recommend you write it for
33-
Python 2.5 or 2.6, and add support for Python3 in a later iteration.
33+
Python 2.5 or 2.6, and add support for Python3 in a later iteration.
34+
35+
Implementations
36+
~~~~~~~~~~~~~~~
37+
38+
There are several popular implementations of the Python programming language on
39+
different back-ends.
40+
41+
CPython
42+
-------
43+
44+
`CPython <http://www.python.org>`_ is the reference implementation of Python,
45+
written in C. It compiles Python code to intermediate bytecode which is then
46+
interpreted by a virtual machine. When people speak of *Python* they often mean
47+
not just the language but also this implementation. It provides the highest
48+
level of compatibility with Python packages and C extension modules.
49+
50+
If you are writing open-source Python code and want to reach the widest possible
51+
audience, targeting CPython is your best bet. If you need to use any packages
52+
that are rely on C extensions for their functionality (eg: numpy) then CPython
53+
is your only choice.
54+
55+
Being the reference implementation, all versions of the Python language are
56+
available as CPython. Python 3 is only available in a CPython implementation.
57+
58+
PyPy
59+
----
60+
61+
`PyPy <http://pypy.org/>`_ is a Python interpreter implemented in a restricted
62+
statically-typed subset of the Python language called RPython. The interpreter
63+
features a just-in-time compiler and supports multiple back-ends (C, CLI, JVM).
64+
65+
PyPy aims for maximum compatibility with the reference CPython implementation
66+
while improving performance.
67+
68+
If you are looking to squeeze more performance out of your Python code, it's
69+
worth giving PyPy a try.
70+
71+
Currently PyPy supports Python 2.7.
72+
73+
Jython
74+
------
75+
76+
`Jython <http://www.jython.org/>`_ is a Python implementation that compiles
77+
Python code to Java byte code that then executes on a JVM. It has the additional
78+
advantage of being able to import and use any Java class the same as a Python
79+
module.
80+
81+
If you need to interface with an existing Java codebase or have other reasons to
82+
need to write Python code for the JVM, Jython is the best choice.
83+
84+
Currently Jython supports up to Python 2.5.
85+
86+
IronPython
87+
----------
88+
89+
`IronPython <http://ironpython.net/>`_ is an implementation of Python for .NET
90+
framework. It can use both Python a .NET framework libraries, and can also
91+
expose Python code to other .NET languages.
92+
93+
`Python Tools for Visual Studio <http://ironpython.net/tools/>`_ integrate
94+
IronPython directly in to the Visual Studio development environment, making it
95+
an ideal choice for Windows developers.
96+
97+
IronPython supports Python 2.7.

0 commit comments

Comments
 (0)