Monday, February 11, 2019

PyPy v7.0.0: triple release of 2.7, 3.5 and 3.6-alpha

The PyPy team is proud to release the version 7.0.0 of PyPy, which includes three different interpreters:
  • PyPy2.7, which is an interpreter supporting the syntax and the features of Python 2.7
  • PyPy3.5, which supports Python 3.5
  • PyPy3.6-alpha: this is the first official release of PyPy to support 3.6 features, although it is still considered alpha quality.
All the interpreters are based on much the same codebase, thus the triple release.
Until we can work with downstream providers to distribute builds with PyPy, we have made packages for some common packages available as wheels.
The GC hooks , which can be used to gain more insights into its performance, has been improved and it is now possible to manually manage the GC by using a combination of gc.disable and gc.collect_step. See the GC blog post.
We updated the cffi module included in PyPy to version 1.12, and the cppyy backend to 1.4. Please use these to wrap your C and C++ code, respectively, for a JIT friendly experience.
As always, this release is 100% compatible with the previous one and fixed several issues and bugs raised by the growing community of PyPy users. We strongly recommend updating.
The PyPy3.6 release and the Windows PyPy3.5 release are still not production quality so your mileage may vary. There are open issues with incomplete compatibility and c-extension support.
The utf8 branch that changes internal representation of unicode to utf8 did not make it into the release, so there is still more goodness coming. You can download the v7.0 releases here:
We would like to thank our donors for the continued support of the PyPy project. If PyPy is not quite good enough for your needs, we are available for direct consulting work.
We would also like to thank our contributors and encourage new people to join the project. PyPy has many layers and we need help with all of them: PyPy and RPython documentation improvements, tweaking popular modules to run on pypy, or general help with making RPython's JIT even better.

What is PyPy?

PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython 2.7, 3.5 and 3.6. It's fast (PyPy and CPython 2.7.x performance comparison) due to its integrated tracing JIT compiler.
We also welcome developers of other dynamic languages to see what RPython can do for them.
The PyPy release supports:
  • x86 machines on most common operating systems (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
  • big- and little-endian variants of PPC64 running Linux,
  • s390x running Linux
Unfortunately at the moment of writing our ARM buildbots are out of service, so for now we are not releasing any binary for the ARM architecture.

What else is new?

PyPy 6.0 was released in April, 2018. There are many incremental improvements to RPython and PyPy, the complete listing is here.

Please update, and continue to help us make PyPy better.

Cheers, The PyPy team


  1. I would be very happy, if at some point request-html would work. Thank you for your great work.


  2. @Rob can you please file an issue with how we can reproduce the problem?

  3. requests-html seems to work with pypy 3.6 -v7.0, but the normal requests not.

    This Code works with cpython

    from requests_html import HTMLSession
    import requests

    def get_url():
        session = HTMLSession()
        #r = session.get('', verify='')
        r = session.get('')
        url = r.html.xpath('//*[@id="latest_link"]/a/@href')
        return url[0]

    def download():
        with open('last_stable_kernel.txt', 'rt') as last_kernel:
            last_kernel =
        url = get_url()
        if url != last_kernel:
            print('New kernel found !!!\n')
            print('Downloading from this url: \n' + url )
            res = requests.get(url, stream = True)
            if res.status_code == # Check the download
                print('Download complete\n')
            print('Writing file to disk.')
            kernel = open('latest_kernel.tar.xz', 'wb')
            for file in res.iter_content(1024):
            with open('last_stable_kernel.txt','wt') as last_kernel:
            return True

            print('I have allready the newest kernel !')
            return False

    if __name__ == "__main__":

  4. The pybench2.0 looks good. (except string mapping)

    Test minimum average operation overhead
    BuiltinFunctionCalls: 0ms 5ms 0.01us 0.005ms
    BuiltinMethodLookup: 0ms 1ms 0.00us 0.006ms
    CompareFloats: 0ms 1ms 0.00us 0.005ms
    CompareFloatsIntegers: 0ms 1ms 0.00us 0.003ms
    CompareIntegers: 0ms 1ms 0.00us 0.007ms
    CompareInternedStrings: 0ms 1ms 0.00us 0.023ms
    CompareLongs: 0ms 1ms 0.00us 0.004ms
    CompareStrings: 0ms 0ms 0.00us 0.016ms
    ComplexPythonFunctionCalls: 12ms 14ms 0.07us 0.007ms
    ConcatStrings: 0ms 1ms 0.00us 0.017ms
    CreateInstances: 8ms 12ms 0.11us 0.013ms
    CreateNewInstances: 8ms 13ms 0.16us 0.012ms
    CreateStringsWithConcat: 0ms 1ms 0.00us 0.014ms
    DictCreation: 11ms 13ms 0.03us 0.005ms
    DictWithFloatKeys: 48ms 50ms 0.06us 0.010ms
    DictWithIntegerKeys: 10ms 11ms 0.01us 0.016ms
    DictWithStringKeys: 11ms 13ms 0.01us 0.016ms
    ForLoops: 3ms 7ms 0.28us 0.003ms
    IfThenElse: 0ms 1ms 0.00us 0.012ms
    ListSlicing: 22ms 24ms 1.69us 0.004ms
    NestedForLoops: 9ms 10ms 0.01us 0.002ms
    NestedListComprehensions: 8ms 11ms 0.92us 0.002ms
    NormalClassAttribute: 5ms 6ms 0.01us 0.011ms
    NormalInstanceAttribute: 4ms 5ms 0.00us 0.022ms
    PythonFunctionCalls: 0ms 2ms 0.01us 0.007ms
    PythonMethodCalls: 59ms 66ms 0.29us 0.012ms
    Recursion: 6ms 7ms 0.15us 0.009ms
    SecondImport: 65ms 74ms 0.74us 0.003ms
    SecondPackageImport: 67ms 70ms 0.70us 0.003ms
    SecondSubmoduleImport: 89ms 92ms 0.92us 0.004ms
    SimpleComplexArithmetic: 0ms 1ms 0.00us 0.007ms
    SimpleDictManipulation: 12ms 16ms 0.01us 0.008ms
    SimpleFloatArithmetic: 0ms 1ms 0.00us 0.010ms
    SimpleIntFloatArithmetic: 0ms 1ms 0.00us 0.010ms
    SimpleIntegerArithmetic: 0ms 1ms 0.00us 0.010ms
    SimpleListComprehensions: 6ms 9ms 0.72us 0.003ms
    SimpleListManipulation: 3ms 5ms 0.00us 0.011ms
    SimpleLongArithmetic: 0ms 1ms 0.00us 0.007ms
    SmallLists: 3ms 4ms 0.01us 0.007ms
    SmallTuples: 0ms 1ms 0.00us 0.007ms
    SpecialClassAttribute: 5ms 6ms 0.01us 0.011ms
    SpecialInstanceAttribute: 4ms 5ms 0.00us 0.022ms
    StringMappings: 838ms 846ms 3.36us 0.017ms
    StringPredicates: 5ms 6ms 0.01us 0.144ms
    StringSlicing: 0ms 1ms 0.00us 0.019ms
    TryExcept: 0ms 0ms 0.00us 0.012ms
    TryFinally: 0ms 2ms 0.01us 0.007ms
    TryRaiseExcept: 0ms 1ms 0.01us 0.009ms
    TupleSlicing: 36ms 38ms 0.15us 0.003ms
    WithFinally: 0ms 2ms 0.01us 0.007ms
    WithRaiseExcept: 0ms 1ms 0.02us 0.013ms
    Totals: 1359ms 1461ms

    Best regards


See also PyPy's IRC channel: #pypy at, or the pypy-dev mailing list.
If the blog post is old, it is pointless to ask questions here about it---you're unlikely to get an answer.