PyPy 2.3 - Terrestrial Arthropod Trap¶
We’re pleased to announce PyPy 2.3, which targets version 2.7.6 of the Python language. This release updates the stdlib from 2.7.3, jumping directly to 2.7.6.
This release also contains several bugfixes and performance improvements, many generated by real users finding corner cases our TDD methods missed. CFFI has made it easier than ever to use existing C code with both cpython and PyPy, easing the transition for packages like cryptography, Pillow (Python Imaging Library [Fork]), a basic port of pygame-cffi, and others.
PyPy can now be embedded in a hosting application, for instance inside uWSGI
You can download the PyPy 2.3 release here:
We would like to thank our donors for the continued support of the PyPy project, and for those who donate to our three sub-projects. We showed quite a bit of progress but we’re slowly running out of funds. Please consider donating more, or even better convince your employer to donate, so we can finish those projects! The three sub-projects are:
- Py3k (supporting Python 3.x): the release PyPy3 2.2 is imminent.
- STM (software transactional memory): a preview will be released very soon, once we fix a few bugs
- NumPy which is included in the PyPy 2.3 release. More details below.
What is PyPy?¶
PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython 2.7. It’s fast (pypy 2.3 and cpython 2.7.x performance comparison; note that cpython’s speed has not changed since 2.7.2) due to its integrated tracing JIT compiler.
This release supports x86 machines running Linux 32/64, Mac OS X 64, Windows, and OpenBSD, as well as newer ARM hardware (ARMv6 or ARMv7, with VFPv3) running Linux.
While we support 32 bit python on Windows, work on the native Windows 64 bit python is still stalling, we would welcome a volunteer to handle that.
Many issues were cleaned up after being reported by users to https://bugs.pypy.org or on IRC at #pypy. Note that we consider performance slowdowns as bugs. Here is a summary of the user-facing changes; for more information see whats-new:
- The ARM port no longer crashes on unaligned memory access to floats and doubles, and singlefloats are supported in the JIT.
- Generators are faster since they now skip unnecessary cleanup
- A first time contributor simplified JIT traces by adding integer bound propagation in indexing and logical operations.
- Optimize consecutive dictionary lookups of the same key in a chain
- Our extensive pre-translation test suite now runs nightly on more platforms
- Fix issues with reimporting builtin modules
- Fix an RPython bug with loop-unrolling that appeared in the HippyVM PHP port
- Support for corner cases on objects with __int__ and __float__ methods
- Fix multithreaded support for gethostbyname_ex and gethostbyaddr
- Fix handling of tp_name for type objects
New Platforms and Features¶
- Support for OpenBSD
- Code cleanup: we continue to prune out old and unused code, and to refactor large parts of the codebase. We have separated RPython from the PyPy python interpreter, and RPython is seeing use in other dynamic language projects.
- Support for precompiled headers in the build process for MSVC
- Tweak support of errno in cpyext (the PyPy implemenation of the capi)
NumPy support has been split into a builtin
_numpy module and a
fork of the NumPy code base adapted to PyPy at
You need to install NumPy separately with a virtualenv:
pip install git+https://bitbucket.org/pypy/numpy.git;
git clone https://bitbucket.org/pypy/numpy.git;
pypy setup.py install.
- NumPy support has been improved, many failures in indexing, dtypes, and scalars were corrected. We are slowly approaching our goal of passing the NumPy test suite. We still do not support object or unicode ndarrays.
- Speed of iteration in dot() is now within 1.5x of the NumPy c
implementation (without BLAS acceleration). Since the same array
iterator is used throughout the
_numpymodule, speed increases should be apparent in all NumPy functionality.
- Most of the core functionality of nditer has been implemented.
- A cffi-based
numpy.randommodule is available as a branch; it will be merged soon after this release.
- Enhancements to the PyPy JIT were made to support virtualizing the raw_store/raw_load memory operations used in NumPy arrays. Further work remains here in virtualizing the alloc_raw_storage when possible. This will allow scalars to have storages but still be virtualized when possible in loops.
The PyPy Team