# Python Programming/PyPy

PyPy is a Python interpreter containing a just-in-time compiler. Python
programs can usually be run by PyPy without modification but for
availability of 3rd party modules since a module made for CPython, the
normal Python interpreter, does not automatically work with PyPy.
Furthermore, some Python programs can run into trouble because of
PyPy\'s different strategy of when to free up allocated objects
including file handles.

The speed-up brought by PyPy compared to CPython depends on the nature
of the task. For some computationally heavy tasks, the speed-up factor
can reach as high as 50. PyPy speed center reports the geometric average
speed-up factor as 7.6, calculated from a set of benchmarks.

PyPy is available both for Python 2 and Python 3, but the version for
Python 3 is slower; the above speed statements pertain to Python 2.

Interactive use of PyPy is possible: you can type \"pypy\" into a
command line, and start interacting with it just like with CPython.

The outputs from PyPy are not guaranteed to be exactly the same as from
CPython. For instance, PyPy can yield items from a set in an order
different from that of CPython since the item order in a set is
arbitrary and not guaranteed to the same between different Python
implementations; for verification, you can compare the results of
{1,2}.pop(). Dictionaries have an arbitrary key order as well.

Floating point results may be slightly different between PyPy and
CPython in some setups as long as PyPy is built with SSE2 instruction
set enabled and CPython is not.

See also ../Performance/.

## External links

-   PyPy, pypy.org
-   PyPy\'s Speed Center, speed.pypy.org
-   PyPy, en.wikipedia.org

