| 1 |
==================================================================== |
| 2 |
PyPy v7.3.2: release of 2.7, 3.6, and 3.7 alpha, released 2020-09-25 |
| 3 |
==================================================================== |
| 4 |
|
| 5 |
The PyPy team is proud to release the version 7.3.2 of PyPy, which includes |
| 6 |
three different interpreters: |
| 7 |
|
| 8 |
- PyPy2.7, which is an interpreter supporting the syntax and the features of |
| 9 |
Python 2.7 including the stdlib for CPython 2.7.13 |
| 10 |
|
| 11 |
- PyPy3.6: which is an interpreter supporting the syntax and the features of |
| 12 |
Python 3.6, including the stdlib for CPython 3.6.9. |
| 13 |
|
| 14 |
- PyPy3.7 alpha: which is our first release of an interpreter supporting the |
| 15 |
syntax and the features of Python 3.7, including the stdlib for CPython |
| 16 |
3.7.9. We call this alpha quality software, there may be issues about |
| 17 |
compatibility with new and changed features in CPython 3.7. |
| 18 |
Please let us know what is broken or missing. We have not implemented the |
| 19 |
`documented changes`_ in the ``re`` module, and a few other pieces are also |
| 20 |
missing. For more information, see the `PyPy 3.7 wiki`_ page |
| 21 |
|
| 22 |
The interpreters are based on much the same codebase, thus the multiple |
| 23 |
release. This is a micro release, all APIs are compatible with the 7.3.0 (Dec |
| 24 |
2019) and 7.3.1 (April 2020) releases, but read on to find out what is new. |
| 25 |
|
| 26 |
.. |
| 27 |
The major new feature is prelminary support for the Universal mode of HPy: a |
| 28 |
new way of writing c-extension modules to totally encapsulate the `PyObject*`. |
| 29 |
The goal, as laid out in the `HPy blog post`_, is to enable a migration path |
| 30 |
for c-extension authors who wish their code to be performant on alternative |
| 31 |
interpreters like GraalPython_ (written on top of the Java virtual machine), |
| 32 |
RustPython_, and PyPy. Thanks to Oracle for sponsoring work on HPy. |
| 33 |
|
| 34 |
Conda Forge now `supports PyPy`_ as a python interpreter. The support is quite |
| 35 |
complete for linux and macOS. This is the result of a lot of |
| 36 |
hard work and goodwill on the part of the Conda Forge team. A big shout out |
| 37 |
to them for taking this on. |
| 38 |
|
| 39 |
Development of PyPy has moved to https://foss.heptapod.net/pypy/pypy. |
| 40 |
This was covered more extensively in this `blog post`_. We have seen an |
| 41 |
increase in the number of drive-by contributors who are able to use gitlab + |
| 42 |
mercurial to create merge requests. |
| 43 |
|
| 44 |
The `CFFI`_ backend has been updated to version 1.14.2. We recommend using CFFI |
| 45 |
rather than c-extensions to interact with C, and using cppyy_ for performant |
| 46 |
wrapping of C++ code for Python. |
| 47 |
|
| 48 |
Numpy has begun shipping `wheels on PyPI` for PyPy, currently for linux 64-bit |
| 49 |
only. Wheels for PyPy windows will be available from the next NumPy release. |
| 50 |
|
| 51 |
A new contributor took us up on the challenge to get `windows 64-bit`` support. |
| 52 |
The work is proceeding on the ``win64`` branch, more help in coding or |
| 53 |
sponsorship is welcome. |
| 54 |
|
| 55 |
As always, this release fixed several issues and bugs. We strongly recommend |
| 56 |
updating. Many of the fixes are the direct result of end-user bug reports, so |
| 57 |
please continue reporting issues as they crop up. |
| 58 |
|
| 59 |
You can find links to download the v7.3.2 releases here: |
| 60 |
|
| 61 |
https://pypy.org/download.html |
| 62 |
|
| 63 |
We would like to thank our donors for the continued support of the PyPy |
| 64 |
project. If PyPy is not quite good enough for your needs, we are available for |
| 65 |
direct consulting work. |
| 66 |
|
| 67 |
We would also like to thank our contributors and encourage new people to join |
| 68 |
the project. PyPy has many layers and we need help with all of them: `PyPy`_ |
| 69 |
and `RPython`_ documentation improvements, tweaking popular modules to run |
| 70 |
on pypy, or general `help`_ with making RPython's JIT even better. Since the |
| 71 |
previous release, we have accepted contributions from 8 new contributors, |
| 72 |
thanks for pitching in. |
| 73 |
|
| 74 |
If you are a python library maintainer and use c-extensions, please consider |
| 75 |
making a cffi / cppyy version of your library that would be performant on PyPy. |
| 76 |
In any case both `cibuildwheel`_ and the `multibuild system`_ support |
| 77 |
building wheels for PyPy. |
| 78 |
|
| 79 |
.. _`PyPy`: index.html |
| 80 |
.. _`RPython`: https://rpython.readthedocs.org |
| 81 |
.. _`help`: project-ideas.html |
| 82 |
.. _`CFFI`: https://cffi.readthedocs.io |
| 83 |
.. _`cppyy`: https://cppyy.readthedocs.io |
| 84 |
.. _`multibuild system`: https://github.com/matthew-brett/multibuild |
| 85 |
.. _`cibuildwheel`: https://github.com/joerick/cibuildwheel |
| 86 |
.. _`blog post`: https://morepypy.blogspot.com/2020/02/pypy-and-cffi-have-moved-to-heptapod.html |
| 87 |
.. _`supports PyPy`: https://conda-forge.org/blog//2020/03/10/pypy |
| 88 |
.. _`documented changes`: https://docs.python.org/3/whatsnew/3.7.html#re |
| 89 |
.. _`PyPy 3.7 wiki`: https://foss.heptapod.net/pypy/pypy/-/wikis/py3.7%20status |
| 90 |
.. _`wheels on PyPI`: https://pypi.org/project/numpy/#files |
| 91 |
.. _`windows 64-bit`: https://foss.heptapod.net/pypy/pypy/-/issues/2073#note_141389 |
| 92 |
.. _`HPy blog post`: https://morepypy.blogspot.com/2019/12/hpy-kick-off-sprint-report.html |
| 93 |
.. _`GraalPython`: https://github.com/graalvm/graalpython |
| 94 |
.. _`RustPython`: https://github.com/RustPython/RustPython |
| 95 |
|
| 96 |
|
| 97 |
What is PyPy? |
| 98 |
============= |
| 99 |
|
| 100 |
PyPy is a Python interpreter, a drop-in replacement for CPython 2.7, 3.6, and |
| 101 |
3.7. It's fast (`PyPy and CPython 2.7.x`_ performance |
| 102 |
comparison) due to its integrated tracing JIT compiler. |
| 103 |
|
| 104 |
We also welcome developers of other `dynamic languages`_ to see what RPython |
| 105 |
can do for them. |
| 106 |
|
| 107 |
This PyPy release supports: |
| 108 |
|
| 109 |
* **x86** machines on most common operating systems |
| 110 |
(Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD) |
| 111 |
|
| 112 |
* big- and little-endian variants of **PPC64** running Linux, |
| 113 |
|
| 114 |
* **s390x** running Linux |
| 115 |
|
| 116 |
* 64-bit **ARM** machines running Linux. |
| 117 |
|
| 118 |
PyPy does support ARM 32 bit processors, but does not release binaries. |
| 119 |
|
| 120 |
.. _`PyPy and CPython 2.7.x`: https://speed.pypy.org |
| 121 |
.. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html |
| 122 |
|
| 123 |
Changelog |
| 124 |
========= |
| 125 |
|
| 126 |
Changes shared across versions |
| 127 |
------------------------------ |
| 128 |
- More sysconfig fixes for win32 |
| 129 |
- Fix ``time.tm_gmtoff`` and ``tm_zone`` on win32 to be like CPython |
| 130 |
- Speed up the performance of matching unicode strings in the sre engine |
| 131 |
- Add jobs control to the Makefile (`issue 3187`_) |
| 132 |
- encode unicodes even in (built-in) files opened in binary mode (`issue 3178`_) |
| 133 |
- Refactor ``RSocket.xxx_into()`` methods and add ``.recvmsg_into()`` |
| 134 |
- Invoke ``pip`` via ``runpy`` in ``ensurepip`` (`merge request 723`_) |
| 135 |
- Fix implementation of PEP 3118 in ``ctypes`` |
| 136 |
- Package macOS as a "portable package" including needed ``dylib`` files |
| 137 |
- Allow overridden ``.__int__()`` in subclasses of ``complex`` |
| 138 |
- More bitbucket -> heptapod documentation fixes |
| 139 |
- Fix path to tcl,tk on windows, `issue 3247`_ |
| 140 |
- Speed up ``list.pop``, ``list.insert`` operations that shift many items (`merge request 729`_) |
| 141 |
- Update win32 to `openssl1.1` |
| 142 |
- Assigning a class instance as ``__get__`` should call the class's |
| 143 |
``__call__``, not its ``__get__`` (`issue 3255`_) |
| 144 |
- Remove all implicit ``str``-``unicode`` conversions in RPython (`merge request 732`_) |
| 145 |
- Need ``FORBID_TEMP_BOXES`` on aarch64, like on arm32, to prevent register spilling (`issue 3188`_) |
| 146 |
- Initialize lock timeout on windows if timeout is infinite (impacted PyPy 2.7 |
| 147 |
only) (`merge request 744`, `issue 3252`_) |
| 148 |
- Move ``lib_pypy/tools`` -> ``lib_pypy/pypy_tools``: otherwise ``tools`` |
| 149 |
appears on the ``sys.path``. This would override any ``tools`` in packages |
| 150 |
like NumPy. |
| 151 |
- Update ``libffi_msvc`` by copying the fixes done in cffi, and also fix when |
| 152 |
returning a ``struct`` in CFFI |
| 153 |
- Add full precision times from ``os.stat`` on macOS |
| 154 |
- PyPy 2.7 only: add SOABI to distutils.sysconfig so wheel gets the correct ABI |
| 155 |
tag |
| 156 |
- Use the full set of format strings in ``time.strftime`` on windows. After the |
| 157 |
transition to a more modern MSVC compiler, windows now supports strings like |
| 158 |
``%D`` and others. |
| 159 |
- Raise like CPython when ``strftime()`` year outside 1 - 9999 on windows |
| 160 |
- Use ``wcsftime`` in ``strftime()`` on windows |
| 161 |
- Fix `issue 3282`_ where iterating over a ``mmap`` should return an ``int``, |
| 162 |
not a ``byte`` |
| 163 |
- Use ``_chsize_s`` for ftruncate on windows: CPython issue 23668_ |
| 164 |
- Allow untranslated tests to run on top of PyPY2.7, not only CPython2.7 |
| 165 |
- Add missing ``os`` functions ``os.sched_rr_get_interval``, |
| 166 |
``os.sched_getscheduler``, ``os.sched_setscheduler``, ``os.sched_getparam`` |
| 167 |
- Set ``buffer`` to ``None`` on close of buffered ``io`` classes |
| 168 |
- Use the ``Suppres_IPH`` context manager wherever CPython uses |
| 169 |
``_Py_BEGIN_SUPPRESS_IPH``, ``_Py_END_SUPPRESS_IPH`` |
| 170 |
- Fix leaked string if an exception occurs in socket.settimeout on windows |
| 171 |
- close open ``mmap`` and ``zipfile`` resources in stdlib tests |
| 172 |
- Make stack 3MB on windows which aligns expectations with Linux |
| 173 |
- Add ``pypyjit.releaseall()`` that marks all current machine code objects as |
| 174 |
ready to release. They will be released at the next GC (unless they are |
| 175 |
currently in use in the stack of one of the threads). |
| 176 |
- Fix possible infinite loop in `tarfile.py`: CPython issue 39017_ |
| 177 |
- Reject control characters in http requests: CPython issue 39603_ |
| 178 |
- Fix regex in parsing http headers to reject infinite backtracking: CPyton |
| 179 |
issue 39503_ |
| 180 |
- Escape the server title when rendering from ``xmlrpc`` as HTML: CPython issue |
| 181 |
38243_ |
| 182 |
- Build fixes for latest XCode on MacOS |
| 183 |
|
| 184 |
|
| 185 |
C-API (cpyext) and c-extensions |
| 186 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 187 |
- Add ``PyCFunction_Call``, ``PyNumber_ToBase``, contiguous part of |
| 188 |
``PyMemoryView_GetContiguous`` |
| 189 |
- use ``space.getitem`` in ``PySequence_ITEM``, fixes `pybind11 2146`_ |
| 190 |
- give preference to ``as_sequence.sq_item`` in ``PySequence_ITEM`` |
| 191 |
- In Py_EnterRecursiveCall, ``char*`` -> ``const char *``, `issue 3232`_ |
| 192 |
- Fix ``PySet_Add`` for ``frozenset`` (`issue 3251`_) |
| 193 |
- Support using ``sq_repeat`` and ``sq_inplace_repeat``, `issue 3281`_ |
| 194 |
|
| 195 |
Python 3.6 only |
| 196 |
--------------- |
| 197 |
- Fix ``_sqlite3.Connection`` with ``isolation_level=None`` in the constructor |
| 198 |
- Fix embedded mode for CFFI (CFFI issue 449) |
| 199 |
- Add ``socket.recvmsg_into`` |
| 200 |
- Fix return types in ``os.readlink()`` (`issue 3177`_) and ``os.listdir()`` |
| 201 |
- Fix `os.listdir()`` for win32 |
| 202 |
- Update ``_ssl`` to handle Post Handshake Authorization callbacks (PHA) |
| 203 |
- Fix ``oldcrc`` argument of ``binascii.crc_hqx`` to ``unsigned int`` |
| 204 |
- Implement ``socket.sethostname()`` (`issue 3198`_) |
| 205 |
- Backport CPython `35519`_: "Rename test.bisect to test.bisect_cmd" from CPython 3.7 |
| 206 |
- Fix the repr of ``SRE_Pattern`` and ``SRE_Match`` |
| 207 |
- Fix ill-defined behaviour with class.__init__ (`issue 3239`_) |
| 208 |
- Improve pickling performance (`issue 3230`_) |
| 209 |
- Forward port race condition fix from PyPy 2.7 ``Lib/weakref.py`` (`issue 3243`_) |
| 210 |
- Implement bpo `30465`_: Fix lineno and col_offset in fstring AST nodes (`merge request 730`_) |
| 211 |
- Implement bpo `29104`_: Fixed parsing backslashes in f-strings (`merge request 736`_) |
| 212 |
- Fix ``time.sleep`` bug in win32 |
| 213 |
- Expose missing ``lzma_stream_encoder`` in cffi ``_lzma`` module (`issue 3242_`) |
| 214 |
- Fix ``os.unsetenv`` on win32, bpo `39413`_ (CPython 3.7+, we can do 3.6+) |
| 215 |
- Add symlinks to ``pypy``, ``pypy3.6`` to linux, macOS tarball. Maybe needed for macOS and multibuild |
| 216 |
- The following sequence no longer makes any copy: ``b = StringBuilder(); |
| 217 |
b.append(some_large_string); s = b.build()`` |
| 218 |
- Add missing ``os`` constants: ``P_NOWAIT``, ``P_NOWAITO``, ``P_WAIT`` |
| 219 |
- Allow codec errorhandlers to modify the underlying str/bytes being converted |
| 220 |
- Do not import ``platform`` at startup (`issue 3269`_) |
| 221 |
- Enable more extensive optimizations of list strategies on Python3, since |
| 222 |
``int`` and ``long`` are the same (`issue 3250`_) |
| 223 |
- Special case bytewise codec errorhandlers ``replace``, ``ignore``, |
| 224 |
``surrogateescape`` to use the same logic as ``final == True`` |
| 225 |
- Allow ``CRTL-C`` to interrupt ``time.sleep`` on windows |
| 226 |
- Inhibit compiler tail-call optimization via ``PYPY_INHIBIT_TAIL_CALL`` on windows |
| 227 |
- When ``pypy -m pip`` fails to find ``pip``, give an error message that hints |
| 228 |
at ``pypy -m ensurepip`` |
| 229 |
- Fix broken ``_socket.share`` on windows |
| 230 |
- Add missing ``os.{gs}et_handle_inheritable`` (PEP 446) on windows |
| 231 |
- Fix ip address hashing in ``ipaddress.py``: CPython issue 41004_ |
| 232 |
- Disallow CR/LF in ``email.headerregistry.Address``: CPython issue 39073_ |
| 233 |
- Ban ``reuse_address`` parameter in ``loop.create_datagram_endpoint()`` in |
| 234 |
``asyncio.base_events``: CPython issue 37228 |
| 235 |
- Preventing newline in ``encodongs.uu.filename`` from corrupting the output |
| 236 |
format: CPython issue 38945 |
| 237 |
- Prevent backtracking in regexes in ``http.cookiejar``: Cpython issue 38804_ |
| 238 |
- Sync ``email._header_value_parser``, ``email._parseaddr`` and their |
| 239 |
respective tests: CPython 37461_ and 34155_ |
| 240 |
- Revert extending ``time.time()`` and friends to accept an optional ``info`` |
| 241 |
argument, use a private ``time`` function instead. |
| 242 |
|
| 243 |
Python 3.6 C-API |
| 244 |
~~~~~~~~~~~~~~~~ |
| 245 |
- Add ``PyType_GetFlags``, ``PyType_GetSlot``, ``PyUnicode_{En,De}code_Locale``, |
| 246 |
``PyUnicode_{Find,Read,Write}Char``, |
| 247 |
- Fix ``PyUnicode_*`` handling on windows where ``wchar_t`` is 2 bytes |
| 248 |
|
| 249 |
.. _`issue 3187`: https://foss.heptapod.net/pypy/pypy/-/issues/3187 |
| 250 |
.. _`issue 3178`: https://foss.heptapod.net/pypy/pypy/-/issues/3178 |
| 251 |
.. _`issue 3177`: https://foss.heptapod.net/pypy/pypy/-/issues/3177 |
| 252 |
.. _`issue 3188`: https://foss.heptapod.net/pypy/pypy/-/issues/3188 |
| 253 |
.. _`issue 3198`: https://foss.heptapod.net/pypy/pypy/-/issues/3198 |
| 254 |
.. _`issue 3232`: https://foss.heptapod.net/pypy/pypy/-/issues/3232 |
| 255 |
.. _`issue 3239`: https://foss.heptapod.net/pypy/pypy/-/issues/3239 |
| 256 |
.. _`issue 3230`: https://foss.heptapod.net/pypy/pypy/-/issues/3230 |
| 257 |
.. _`issue 3242`: https://foss.heptapod.net/pypy/pypy/-/issues/3242 |
| 258 |
.. _`issue 3243`: https://foss.heptapod.net/pypy/pypy/-/issues/3243 |
| 259 |
.. _`issue 3247`: https://foss.heptapod.net/pypy/pypy/-/issues/3247 |
| 260 |
.. _`issue 3250`: https://foss.heptapod.net/pypy/pypy/-/issues/3250 |
| 261 |
.. _`issue 3251`: https://foss.heptapod.net/pypy/pypy/-/issues/3251 |
| 262 |
.. _`issue 3252`: https://foss.heptapod.net/pypy/pypy/-/issues/3252 |
| 263 |
.. _`issue 3255`: https://foss.heptapod.net/pypy/pypy/-/issues/3255 |
| 264 |
.. _`issue 3269`: https://foss.heptapod.net/pypy/pypy/-/issues/3269 |
| 265 |
.. _`issue 3274`: https://foss.heptapod.net/pypy/pypy/-/issues/3274 |
| 266 |
.. _`issue 3282`: https://foss.heptapod.net/pypy/pypy/-/issues/3282 |
| 267 |
.. _`issue 3281`: https://foss.heptapod.net/pypy/pypy/-/issues/3281 |
| 268 |
|
| 269 |
.. _`merge request 723`: https://foss.heptapod.net/pypy/pypy/-/merge_request/723 |
| 270 |
.. _`merge request 729`: https://foss.heptapod.net/pypy/pypy/-/merge_request/729 |
| 271 |
.. _`merge request 730`: https://foss.heptapod.net/pypy/pypy/-/merge_request/730 |
| 272 |
.. _`merge request 736`: https://foss.heptapod.net/pypy/pypy/-/merge_request/736 |
| 273 |
.. _`merge request 732`: https://foss.heptapod.net/pypy/pypy/-/merge_request/732 |
| 274 |
.. _`merge request 744`: https://foss.heptapod.net/pypy/pypy/-/merge_request/744 |
| 275 |
|
| 276 |
.. _31976: https://bugs.python.org/issue31976 |
| 277 |
.. _35519: https://bugs.python.org/issue35519 |
| 278 |
.. _30465: https://bugs.python.org/issue30465 |
| 279 |
.. _39413: https://bugs.python.org/issue39413 |
| 280 |
.. _23668: https://bugs.python.org/issue23668 |
| 281 |
.. _29104: https://bugs.python.org/issue29104 |
| 282 |
.. _39017: https://bugs.python.org/issue39017 |
| 283 |
.. _41014: https://bugs.python.org/issue41014 |
| 284 |
.. _39603: https://bugs.python.org/issue39603 |
| 285 |
.. _39503: https://bugs.python.org/issue39503 |
| 286 |
.. _39073: https://bugs.python.org/issue39073 |
| 287 |
.. _37228: https://bugs.python.org/issue37228 |
| 288 |
.. _38945: https://bugs.python.org/issue38945 |
| 289 |
.. _38804: https://bugs.python.org/issue38804 |
| 290 |
.. _38243: https://bugs.python.org/issue38243 |
| 291 |
.. _37461: https://bugs.python.org/issue37461 |
| 292 |
.. _34155: https://bugs.python.org/issue34155 |
| 293 |
.. _41004: https://bugs.python.org/issue41004 |
| 294 |
|
| 295 |
.. _`pybind11 2146`: https://github.com/pybind/pybind11/pull/2146 |