What’s new in PyPy2.7 5.6

Backport rpython changes made directly on the py3k and py3.5 branches.

Implement PyObject_GetBuffer, PyMemoryView_GET_BUFFER, and handles memoryviews in numpypy

Improve merging of virtual states in the JIT in order to avoid jumping to the preamble. Accomplished by allocating virtual objects where non-virtuals are expected.

JIT residual calls: if the called function starts with a fast-path like “if x.foo != 0: return x.foo”, then inline the check before doing the CALL. For now, string hashing is about the only case.

The compiled pypy now looks for its lib-python/lib_pypy path starting from the location of the libpypy-c instead of the executable. This is arguably more consistent, and also it is what occurs anyway if you’re embedding pypy. Linux distribution packagers, take note! At a minimum, the libpypy-c.so must really be inside the path containing lib-python and lib_pypy. Of course, you can put a symlink to it from somewhere else. You no longer have to do the same with the pypy executable, as long as it finds its libpypy-c.so library.

CPython allows warning.warn((‘something’, 1), Warning), on PyPy this produced a “expected a readable buffer object” error. Test and fix.

CPython rejects ‘a’.strip(buffer(‘ ‘)); only None, str or unicode are allowed as arguments. Test and fix for str and unicode

Port the ‘faulthandler’ module to PyPy default. This module is standard in Python 3.3 but can also be installed from CPython >= 2.6 from PyPI.

Refactor cpyext testing to be more pypy3-friendly.

Improve the error message when the user forgot the “self” argument of a method.

Change the timeit module: it now prints the average time and the standard deviation over 7 runs by default, instead of the minimum. The minimum is often misleading.

Make optimiseopt iterative instead of recursive so it can be reasoned about more easily and debugging is faster.

Update stdlib to version 2.7.12

Improve support for new buffer interface in cpyext, bf_getbuffer on built-in types still missing

Improve compatibility with CPython in the struct module. In particular, struct.unpack now returns an int whenever the returned value fits, while previously it always returned a long for certains format codes such as Q (and also I, L and q on 32 bit)

s390x implementation for vector operations used in VecOpt

PowerPC implementation for vector operations used in VecOpt

Match CPython’s stricter handling of __new__/__init__ arguments

Support for OpenSSL version 1.1 (in addition to version 1.0). Tested on Linux (1.1, 1.0), on Win32, and Mac (1.0 only)