| 1 |
========================================================================== |
| 2 |
PyPy v7.3.6: release of python 2.7, 3.7, and 3.8-beta, released 2021-10-17 |
| 3 |
========================================================================== |
| 4 |
|
| 5 |
The PyPy team is proud to release version 7.3.6 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.18+ (the ``+`` is for |
| 10 |
backported security updates) |
| 11 |
|
| 12 |
- PyPy3.7, which is an interpreter supporting the syntax and the features of |
| 13 |
Python 3.7, including the stdlib for CPython 3.7.12. |
| 14 |
|
| 15 |
- PyPy3.8, which is an interpreter supporting the syntax and the features of |
| 16 |
Python 3.8, including the stdlib for CPython 3.8.12. Since this is our |
| 17 |
first release of the interpreter, we relate to this as "beta" quality. We |
| 18 |
welcome testing of this version, if you discover incompatibilites, please |
| 19 |
report them so we can gain confidence in the version. |
| 20 |
|
| 21 |
The interpreters are based on much the same codebase, thus the multiple |
| 22 |
release. This is a micro release, all APIs are compatible with the other 7.3 |
| 23 |
releases. Highlights of the release, since the release of 7.3.5 in May 2021, |
| 24 |
include: |
| 25 |
|
| 26 |
- We have merged a backend for HPy_, the better C-API interface. The backend |
| 27 |
implements version 0.0.3. |
| 28 |
- Translation of PyPy into a binary, known to be slow, is now about 40% |
| 29 |
faster. On a modern machine, PyPy3.8 can translate in about 20 minutes. |
| 30 |
- PyPy Windows 64 is now available on conda-forge_, along with over 600 |
| 31 |
commonly used binary packages. This new offering joins the more than 1000 |
| 32 |
conda packages for PyPy on Linux and macOS. Many thanks to the conda-forge |
| 33 |
maintainers for pushing this forward over the past 18 months. |
| 34 |
- Speed improvements were made to ``io``, ``sum``, ``_ssl`` and more. These |
| 35 |
were done in response to user feedback. |
| 36 |
- The 3.8 version of the release contains a beta-quality improvement to the |
| 37 |
JIT to better support `compiling huge Python functions`_ by breaking them |
| 38 |
up into smaller pieces. |
| 39 |
- The release of Python3.8 required a concerted effort. We were greatly |
| 40 |
helped by @isidentical (Batuhan Taskaya) and other new contributors. |
| 41 |
- The 3.8 package now uses the same layout as CPython, and many of the |
| 42 |
PyPy-specific changes to ``sysconfig``, ``distutils.sysconfig``, and |
| 43 |
``distutils.commands.install.py`` have been removed. The ``stdlib`` now |
| 44 |
is located in ``<base>/lib/pypy3.8`` on ``posix`` systems, and in |
| 45 |
``<base>/Lib`` on Windows. The include files on windows remain the same, |
| 46 |
on ``posix`` they are in ``<base>/include/pypy3.8``. Note we still use the |
| 47 |
``pypy`` prefix to prevent mixing the files with CPython (which uses |
| 48 |
``python``. |
| 49 |
|
| 50 |
.. _`compiling huge Python functions`: https://www.pypy.org/posts/2021/09/jit-auto-generated-code.html |
| 51 |
|
| 52 |
|
| 53 |
We recommend updating. You can find links to download the v7.3.6 releases here: |
| 54 |
|
| 55 |
https://pypy.org/download.html |
| 56 |
|
| 57 |
We would like to thank our donors for the continued support of the PyPy |
| 58 |
project. If PyPy is not quite good enough for your needs, we are available for |
| 59 |
direct consulting work. If PyPy is helping you out, we would love to hear about |
| 60 |
it and encourage submissions to our blog_ via a pull request |
| 61 |
to https://github.com/pypy/pypy.org |
| 62 |
|
| 63 |
We would also like to thank our contributors and encourage new people to join |
| 64 |
the project. PyPy has many layers and we need help with all of them: `PyPy`_ |
| 65 |
and `RPython`_ documentation improvements, tweaking popular modules to run |
| 66 |
on PyPy, or general `help`_ with making RPython's JIT even better. Since the |
| 67 |
previous release, we have accepted contributions from 7 new contributors, |
| 68 |
thanks for pitching in, and welcome to the project! |
| 69 |
|
| 70 |
If you are a python library maintainer and use C-extensions, please consider |
| 71 |
making a CFFI_ / cppyy_ version of your library that would be performant on PyPy. |
| 72 |
In any case both `cibuildwheel`_ and the `multibuild system`_ support |
| 73 |
building wheels for PyPy. |
| 74 |
|
| 75 |
.. _`PyPy`: index.html |
| 76 |
.. _`RPython`: https://rpython.readthedocs.org |
| 77 |
.. _`help`: project-ideas.html |
| 78 |
.. _CFFI: https://cffi.readthedocs.io |
| 79 |
.. _cppyy: https://cppyy.readthedocs.io |
| 80 |
.. _`multibuild system`: https://github.com/matthew-brett/multibuild |
| 81 |
.. _`cibuildwheel`: https://github.com/joerick/cibuildwheel |
| 82 |
.. _blog: https://pypy.org/blog |
| 83 |
.. _`conda-forge`: https://conda-forge.org/blog//2020/03/10/pypy |
| 84 |
.. _HPy: https://hpyproject.org/ |
| 85 |
|
| 86 |
|
| 87 |
What is PyPy? |
| 88 |
============= |
| 89 |
|
| 90 |
PyPy is a Python interpreter, a drop-in replacement for CPython 2.7, 3.7, and |
| 91 |
soon 3.8. It's fast (`PyPy and CPython 3.7.4`_ performance |
| 92 |
comparison) due to its integrated tracing JIT compiler. |
| 93 |
|
| 94 |
We also welcome developers of other `dynamic languages`_ to see what RPython |
| 95 |
can do for them. |
| 96 |
|
| 97 |
This PyPy release supports: |
| 98 |
|
| 99 |
* **x86** machines on most common operating systems |
| 100 |
(Linux 32/64 bits, Mac OS X 64 bits, Windows 64 bits, OpenBSD, FreeBSD) |
| 101 |
|
| 102 |
* big- and little-endian variants of **PPC64** running Linux, |
| 103 |
|
| 104 |
* **s390x** running Linux |
| 105 |
|
| 106 |
* 64-bit **ARM** machines running Linux. |
| 107 |
|
| 108 |
PyPy does support Windows 32-bit and ARM 32 bit processors, but does not |
| 109 |
release binaries. Please reach out to us if you wish to sponsor releases for |
| 110 |
those platforms. |
| 111 |
|
| 112 |
.. _`PyPy and CPython 3.7.4`: https://speed.pypy.org |
| 113 |
.. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html |
| 114 |
|
| 115 |
Changelog |
| 116 |
========= |
| 117 |
|
| 118 |
Bugfixes shared across versions |
| 119 |
------------------------------- |
| 120 |
- Backport fix for `bpo 44022`_ in ``httplib`` |
| 121 |
- Make ``dotviewer`` Python3 compatible and add some features (like rudimentary |
| 122 |
record support). |
| 123 |
- Fix error reporting when the error position is the last character of a JSON |
| 124 |
bytestring (issue 3514_) |
| 125 |
- Set non-volatile xmm registers in the JIT for windows 64-bit calling |
| 126 |
conventions. Fixes a bug where the JIT was not restoring registers when |
| 127 |
returning from a call |
| 128 |
- Support multiple tags in ``hg_archive``, fixes ``platform._sys_version()`` |
| 129 |
which was reporting the first tag (i.e. rc1) when it should have reported |
| 130 |
the last tag (i.e. final) |
| 131 |
- Fix position bugs in the astcompiler stemming from the fact that |
| 132 |
``SyntaxErrors`` use 1-based column offsets |
| 133 |
- Fix an obscure corner of ``%``-formatting when a tuple is passed in that |
| 134 |
triggered infinite recursion in the ``__repr__`` of a ``named_tuple`` with an |
| 135 |
``__iter__`` (issue 3555_) |
| 136 |
- Fixed a PowerPC JIT bug that caused a stack overflow (issue 3463_) |
| 137 |
|
| 138 |
Speedups and enhancements shared across versions |
| 139 |
------------------------------------------------ |
| 140 |
- Speed up RPython typing |
| 141 |
- Speed up RPython graph cycle finding by removing leaves before checking |
| 142 |
for cycles |
| 143 |
- Speed up C compilation on GCC by using the pre-compiled header feature |
| 144 |
- When switching from an unwrapped list strategy to the ``ObjectListStrategy``, |
| 145 |
try to cache wrapped elements. This prevents the memory blowup on |
| 146 |
code like ``l = [0] * N; l[0] = "abc"`` (issue 2881_). |
| 147 |
- Specialize builtin ``sum`` for lists/tuples (issue 3492_). |
| 148 |
- Update to cffi 1.14.6 |
| 149 |
- Use ``libffi-7.dll`` on windows instead of an old vendored version of |
| 150 |
``libffi`` |
| 151 |
- Fix for a corner case missing an optimization: ``interpindirect2app()`` on a |
| 152 |
function with signature ``'self, space, __args__'`` was missing the |
| 153 |
optimization for that signature, which works with ``interp2app()``. It's |
| 154 |
used in ``_hpy_universal``. |
| 155 |
- Add an option to the packaging script to force non-portable packaging (issue |
| 156 |
3538_) |
| 157 |
- Switch to "powersort" merging strategy by Munro and Wild instead the timsort |
| 158 |
algorithm (`bpo 34561`_) |
| 159 |
- Check env keys for ``'='`` when calling ``os.execve`` |
| 160 |
- Provide a PyPy-only scoped way to malloc buffers in cffi and use it in |
| 161 |
``ssl.read`` |
| 162 |
|
| 163 |
C-API (cpyext) and C-extensions |
| 164 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 165 |
We are no longer backporting changes to the ``cpyext`` compatibility layer to |
| 166 |
PyPy2.7. |
| 167 |
|
| 168 |
|
| 169 |
Python 3.7+ bugfixes |
| 170 |
-------------------- |
| 171 |
- Fix MemoryError on zip.read in shutil._unpack_zipfile for large files `bpo |
| 172 |
43650`_ |
| 173 |
- Fix some issues around the ``obj`` field of ``memoryview``, and add missing |
| 174 |
``toreadonly``. |
| 175 |
- Fix ``re.sub()`` with no match and with unusual types of arguments (issue |
| 176 |
3515_) |
| 177 |
- Fix ``_socket.sethostname()`` failure when passed bytes |
| 178 |
- Switch ``sys.implementation.version`` and ``sys.implementation.hexversion`` |
| 179 |
to ``pypy_version_info`` (i.e. (7, 3. 6) not (3, 7. 10)) (issue 3129_) |
| 180 |
- Fix ``pypy -Wonce`` (issue 3411_) |
| 181 |
|
| 182 |
Python 3.7+ speedups and enhancements |
| 183 |
------------------------------------- |
| 184 |
- Speed up cached imports by re-implementing (a subset of) `bpo 22557`_. This |
| 185 |
brings PyPy3.7 very close to the speed of PyPy2 (issue 3431_) |
| 186 |
- Ignore finalizers on built-in ``io`` classes if we know the stream is closed. |
| 187 |
Also find some other optimizations around ``io`` operations. |
| 188 |
- Add more fields to ``sysconfig.get_config_var`` via ``_sysconfigdata`` (issue |
| 189 |
3483_) |
| 190 |
- Add a ``sys.implementation._multiarch`` field like CPython on linux and |
| 191 |
darwin |
| 192 |
- Add a ``lib_pypy\_sysconfigdata__*.py`` file like CPython on linux, darwin |
| 193 |
during packaging via ``sysconfig._generate_posix_vars()`` (issue 3483_) |
| 194 |
- Slightly adapt the packaging and cffi-module build scripts for compatibility |
| 195 |
with conda-forge. |
| 196 |
- Create ``pypy.exe``, ``pypyw.exe``, ``python.exe``, ``pythonw.exe`` when |
| 197 |
packaging for windows |
| 198 |
- Speed up ``_ssl`` error processing by moving the class out of |
| 199 |
``_PySSL_errno`` and creating a fast-path for instantiation (issue 3490_) |
| 200 |
- Support HPy 0.0.2 |
| 201 |
- Use CPython list of consts in ``os.{confstr,pathconf,sysconf}_names`` (issue |
| 202 |
3502_) |
| 203 |
- Add ``_winapi.GetFileType`` and ``FILE_TYPE_*`` values (issue 3531_) |
| 204 |
- Allow ``ctypes.POINTER()`` to cast `ctypes.array`` (issue 3546_) |
| 205 |
- Update the stdlib to v3.7.12 |
| 206 |
|
| 207 |
Python 3.7 C-API |
| 208 |
~~~~~~~~~~~~~~~~ |
| 209 |
- Add PEP 495 c-api ``TimeAndFold`` datetime constructors (issue 2987_) |
| 210 |
- Allow ``NULL`` in ``PyErr_WriteUnraisable`` (issue 3353_) |
| 211 |
- Support ``*TimeZone*`` functions in datetime |
| 212 |
- Add slot functions so ``int(x)`` and ``float(x)`` work properly where |
| 213 |
``x`` is a c-extension class |
| 214 |
- When creating a ``PyUnicodeObject``, use the compact form to store the data |
| 215 |
directly on the object and not via an additional buffer. This is used in |
| 216 |
pythran via ``_PyUnicode_COMPACT_DATA`` even though it is a "private" |
| 217 |
interface. |
| 218 |
- Add ``PyGILState_Check``, ``PyContextVar_New``, ``PyContextVar_Get``, |
| 219 |
``PyContextVar_Set`` |
| 220 |
- Add ``PyExc_WindowsError`` (issue 3472_) |
| 221 |
- Add ``frame.f_back``, assuming the user is aware of the dangers of examinig |
| 222 |
the stack |
| 223 |
- Fix typo in ``import.h`` |
| 224 |
|
| 225 |
.. _2881: https://foss.heptapod.net/pypy/pypy/-/issues/2881 |
| 226 |
.. _2987: https://foss.heptapod.net/pypy/pypy/-/issues/2987 |
| 227 |
.. _3129: https://foss.heptapod.net/pypy/pypy/-/issues/3129 |
| 228 |
.. _3353: https://foss.heptapod.net/pypy/pypy/-/issues/3353 |
| 229 |
.. _3431: https://foss.heptapod.net/pypy/pypy/-/issues/3431 |
| 230 |
.. _3402: https://foss.heptapod.net/pypy/pypy/-/issues/3402 |
| 231 |
.. _3411: https://foss.heptapod.net/pypy/pypy/-/issues/3411 |
| 232 |
.. _3463: https://foss.heptapod.net/pypy/pypy/-/issues/3463 |
| 233 |
.. _3472: https://foss.heptapod.net/pypy/pypy/-/issues/3472 |
| 234 |
.. _3483: https://foss.heptapod.net/pypy/pypy/-/issues/3483 |
| 235 |
.. _3490: https://foss.heptapod.net/pypy/pypy/-/issues/3490 |
| 236 |
.. _3492: https://foss.heptapod.net/pypy/pypy/-/issues/3492 |
| 237 |
.. _3502: https://foss.heptapod.net/pypy/pypy/-/issues/3502 |
| 238 |
.. _3514: https://foss.heptapod.net/pypy/pypy/-/issues/3514 |
| 239 |
.. _3515: https://foss.heptapod.net/pypy/pypy/-/issues/3515 |
| 240 |
.. _3531: https://foss.heptapod.net/pypy/pypy/-/issues/3531 |
| 241 |
.. _3538: https://foss.heptapod.net/pypy/pypy/-/issues/3538 |
| 242 |
.. _3546: https://foss.heptapod.net/pypy/pypy/-/issues/3546 |
| 243 |
.. _3555: https://foss.heptapod.net/pypy/pypy/-/issues/3555 |
| 244 |
.. _`bpo 22557`: https://bugs.python.org/issue22557 |
| 245 |
.. _`bpo 44022`: https://bugs.python.org/issue44022 |
| 246 |
.. _`bpo 43650`: https://bugs.python.org/issue43650 |
| 247 |
.. _`bpo 34561`: https://bugs.python.org/issue34561 |