| 1 |
============================================================================== |
| 2 |
PyPy v7.3.8: release of python 2.7, 3.7, 3.8, and 3.9-beta, released 2022-2-20 |
| 3 |
============================================================================== |
| 4 |
|
| 5 |
The PyPy team is proud to release version 7.3.8 of PyPy. It has been only a few |
| 6 |
months since our last release, but we have some nice speedups and bugfixes we |
| 7 |
wish to share. The release includes four different interpreters: |
| 8 |
|
| 9 |
- PyPy2.7, which is an interpreter supporting the syntax and the features of |
| 10 |
Python 2.7 including the stdlib for CPython 2.7.18+ (the ``+`` is for |
| 11 |
backported security updates) |
| 12 |
|
| 13 |
- PyPy3.7, which is an interpreter supporting the syntax and the features of |
| 14 |
Python 3.7, including the stdlib for CPython 3.7.12. This will be the last |
| 15 |
release of PyPy3.7. |
| 16 |
|
| 17 |
- PyPy3.8, which is an interpreter supporting the syntax and the features of |
| 18 |
Python 3.8, including the stdlib for CPython 3.8.12. This is our third |
| 19 |
release of this interpreter, and we are removing the "beta" tag. |
| 20 |
|
| 21 |
- PyPy3.9, which is an interpreter supporting the syntax and the features of |
| 22 |
Python 3.9, including the stdlib for CPython 3.9.10. As this is our first |
| 23 |
release of this interpreter, we relate to this as "beta" quality. We |
| 24 |
welcome testing of this version, if you discover incompatibilities, please |
| 25 |
report them so we can gain confidence in the version. |
| 26 |
|
| 27 |
The interpreters are based on much the same codebase, thus the multiple |
| 28 |
release. This is a micro release, all APIs are compatible with the other 7.3 |
| 29 |
releases. Highlights of the release, since the release of 7.3.7 in late October 2021, |
| 30 |
include: |
| 31 |
|
| 32 |
- PyPy3.9 uses an RPython version of the PEG parser which brought with it a |
| 33 |
cleanup of the lexer and parser in general |
| 34 |
- Fixed a regression in PyPy3.8 when JITting empty list comprehensions |
| 35 |
- Tweaked some issues around changing the file layout after packaging to make |
| 36 |
the on-disk layout of PyPy3.8 more compatible with CPython. This requires |
| 37 |
``setuptools>=58.1.0`` |
| 38 |
- RPython now allows the target executable to have a ``.`` in its name, so |
| 39 |
PyPy3.9 will produce a ``pypy3.9-c`` and ``libpypy3.9-c.so``. Changing the |
| 40 |
name of the shared object to be version-specific (it used to be |
| 41 |
``libpypy3-c.so``) will allow it to live alongside other versions. |
| 42 |
- Building PyPy3.9+ accepts a ``--platlibdir`` argument like CPython. |
| 43 |
- Improvement in ssl's use of CFFI buffers to speed up ``recv`` and ``recvinto`` |
| 44 |
- Update the packaged OpenSSL to 1.1.1m |
| 45 |
|
| 46 |
We recommend updating. You can find links to download the v7.3.8 releases here: |
| 47 |
|
| 48 |
https://pypy.org/download.html |
| 49 |
|
| 50 |
We would like to thank our donors for the continued support of the PyPy |
| 51 |
project. If PyPy is not quite good enough for your needs, we are available for |
| 52 |
direct consulting work. If PyPy is helping you out, we would love to hear about |
| 53 |
it and encourage submissions to our blog_ via a pull request |
| 54 |
to https://github.com/pypy/pypy.org |
| 55 |
|
| 56 |
We would also like to thank our contributors and encourage new people to join |
| 57 |
the project. PyPy has many layers and we need help with all of them: `PyPy`_ |
| 58 |
and `RPython`_ documentation improvements, tweaking popular modules to run |
| 59 |
on PyPy, or general `help`_ with making RPython's JIT even better. Since the |
| 60 |
previous release, we have accepted contributions from 6 new contributors, |
| 61 |
thanks for pitching in, and welcome to the project! |
| 62 |
|
| 63 |
If you are a python library maintainer and use C-extensions, please consider |
| 64 |
making a HPy_ / CFFI_ / cppyy_ version of your library that would be performant |
| 65 |
on PyPy. |
| 66 |
In any case both `cibuildwheel`_ and the `multibuild system`_ support |
| 67 |
building wheels for PyPy. |
| 68 |
|
| 69 |
.. _`PyPy`: index.html |
| 70 |
.. _`RPython`: https://rpython.readthedocs.org |
| 71 |
.. _`help`: project-ideas.html |
| 72 |
.. _CFFI: https://cffi.readthedocs.io |
| 73 |
.. _cppyy: https://cppyy.readthedocs.io |
| 74 |
.. _`multibuild system`: https://github.com/matthew-brett/multibuild |
| 75 |
.. _`cibuildwheel`: https://github.com/joerick/cibuildwheel |
| 76 |
.. _blog: https://pypy.org/blog |
| 77 |
.. _HPy: https://hpyproject.org/ |
| 78 |
|
| 79 |
What is PyPy? |
| 80 |
============= |
| 81 |
|
| 82 |
PyPy is a Python interpreter, a drop-in replacement for CPython 2.7, 3.7, 3.8 and |
| 83 |
3.9. It's fast (`PyPy and CPython 3.7.4`_ performance |
| 84 |
comparison) due to its integrated tracing JIT compiler. |
| 85 |
|
| 86 |
We also welcome developers of other `dynamic languages`_ to see what RPython |
| 87 |
can do for them. |
| 88 |
|
| 89 |
This PyPy release supports: |
| 90 |
|
| 91 |
* **x86** machines on most common operating systems |
| 92 |
(Linux 32/64 bits, Mac OS X 64 bits, Windows 64 bits, OpenBSD, FreeBSD) |
| 93 |
|
| 94 |
* 64-bit **ARM** machines running Linux. A shoutout to Huawei for sponsoring |
| 95 |
the VM running the tests. |
| 96 |
|
| 97 |
* **s390x** running Linux |
| 98 |
|
| 99 |
* big- and little-endian variants of **PPC64** running Linux, |
| 100 |
|
| 101 |
PyPy support Windows 32-bit, PPC64 big- and little-endian, and ARM 32 bit, but |
| 102 |
does not release binaries. Please reach out to us if you wish to sponsor |
| 103 |
releases for those platforms. |
| 104 |
|
| 105 |
.. _`PyPy and CPython 3.7.4`: https://speed.pypy.org |
| 106 |
.. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html |
| 107 |
|
| 108 |
Known Issues with PyPy3.9 |
| 109 |
========================= |
| 110 |
|
| 111 |
- There is still a known `speed regression`_ around ``**kwargs`` handling |
| 112 |
- We slightly modified the concurrent future's ``ProcessExcecutorPool`` to |
| 113 |
start all the worker processes when the first task is received (like on |
| 114 |
Python3.8) to avoid an apparent race condition when using ``fork`` and |
| 115 |
threads (issue 3650_). |
| 116 |
|
| 117 |
Changelog |
| 118 |
========= |
| 119 |
|
| 120 |
Bugfixes shared across versions |
| 121 |
------------------------------- |
| 122 |
- Fix error formatting of in-place TypeErrors (``a += 'aa'`` ) |
| 123 |
- Fix corner case in ``float.fromhex`` (bpo44954_) |
| 124 |
- Copy ``dtoa`` changes from CPython (bpo40780_) |
| 125 |
- Use ``symtable`` to improve the position of "duplicate argument" errors |
| 126 |
- Add ``__builtins__`` to globals ``dict`` when calling ``eval`` (issue 3584_) |
| 127 |
- Update embedded OpenSSL to 1.1.1m (bpo43522_) |
| 128 |
- Avoid using ``epoll_event`` directly from RPython since it is a ``packed struct`` |
| 129 |
- Clean up some compilation warnings around `const char *`` conversions to |
| 130 |
``char *`` |
| 131 |
- Make sure that frozensets cannot be mutated by using methods from set (issue |
| 132 |
3676_) |
| 133 |
|
| 134 |
Speedups and enhancements shared across versions |
| 135 |
------------------------------------------------ |
| 136 |
- Add unicodedata version 13, make 3.2 the basis of unicodedata compression |
| 137 |
- Use 10.9 as a minimum ``MACOSX_DEPLOYMENT_TARGET`` to match CPython |
| 138 |
- Only compute the ``Some*`` annotation types once, not every time we call a |
| 139 |
type checked function |
| 140 |
- Update version of pycparser to 2.21 |
| 141 |
- Update vendored vmprof to support ppc64 |
| 142 |
- Update CFFI to 1.15.0, no real changes |
| 143 |
- Stop doing guard strengthening with guards that come from inlining the short |
| 144 |
preamble. Doing that can lead to endless bridges (issue 3598_) |
| 145 |
- Split `__pypy__.do_what_I_mean()`` into the original plus ``__pypy__._internal_crash`` |
| 146 |
to make the meaning more clear. These are functions only useful for internal |
| 147 |
testing (issue 3617_). |
| 148 |
- Prepare ``_ssl`` for OpenSSL3 |
| 149 |
- Improve ``x << y`` where ``x`` and ``y`` are ``ints`` but the results doesn't fit |
| 150 |
into a machine word: don't convert ``y`` to ``rbigint`` and back to int |
| 151 |
- Avoid updating counter when using `--jit off`. |
| 152 |
- Speed up ``str`` -> ``float`` conversion for the fast path (ascii, no ``'_'``, no |
| 153 |
``INF``, no leading or trailing whitespace). PyPy with `--jit off`` is now |
| 154 |
faster than CPython for this fastpath (issue 3682_). |
| 155 |
|
| 156 |
C-API (cpyext) and C-extensions |
| 157 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 158 |
We are no longer backporting changes to the ``cpyext`` compatibility layer to |
| 159 |
PyPy2.7. |
| 160 |
|
| 161 |
|
| 162 |
Python 3.7+ bugfixes |
| 163 |
-------------------- |
| 164 |
|
| 165 |
- Fix various problems with the Windows ``_overlapped`` module (issue 3589_, ) |
| 166 |
- Fix error generation on ``_ssl`` in Windows |
| 167 |
- Properly handle ``_PYTHON_SYSCONFIGDATA_NAME`` when importing ``_sysconfigdata`` |
| 168 |
- Restore broken revdb GC support |
| 169 |
- Fix ``sys.path[0]`` to be ``''`` (not the actual full path) when run interactively |
| 170 |
- Add ``_socket.socket.timeout`` getter |
| 171 |
- Fix overflow detection on ``array.array`` on windows (issue 3604_) |
| 172 |
- Add a typedef for ``AsyncGenValueWrapper`` since you can reach it with a |
| 173 |
trace hook, leading to a segfault |
| 174 |
- Add an ``index`` value to ``iter(range()).__reduce__`` for compatibility |
| 175 |
- Fix position of syntax errors raised while parsing f-string subexpressions |
| 176 |
- Fix stack effect of ``EXTENDED_ARG`` |
| 177 |
- Fix incrementality in the unicode escape handler |
| 178 |
- Like CPython, limit ``pwd.getpwnam`` to ``str`` (issue 3624_) |
| 179 |
- Only use ``run_fork_hooks`` in ``_posixprocess.fork_exec`` if ``preexec_fn`` |
| 180 |
is used (issue 3630_) |
| 181 |
- Remove redundant call to ``threading._after_fork`` (issue 3623_) |
| 182 |
- Fix filename in exception raised sometimes when running code with ``-c`` |
| 183 |
- Fixes for the ``signal`` module on windows so that ``raise_signal`` will not |
| 184 |
segfault |
| 185 |
- Detail about ``PYTHONIOENCODING``: if the encoding or the error is omitted, |
| 186 |
always use ``utf-8/strict`` (instead of asking the locale) |
| 187 |
- Disallow overriding the ``__context__`` descriptor from ``BaseException`` |
| 188 |
when chaining exceptions (issue 3644_) |
| 189 |
- Replace ``raise ImportError`` with ``raise ModuleNotFoundError`` where |
| 190 |
appropriate in pure-python equivalents of CPython builtin modules |
| 191 |
- Add missing ``rewinddir()`` at the end of ``os.scandir`` |
| 192 |
- ``os.dup2`` now returns ``fd2`` |
| 193 |
- Make ``__fspath__`` errors compatible with CPython |
| 194 |
- Fix handling of backslash in raw unicode escape decoders that don't |
| 195 |
start valid escape sequences (issue 3652_) |
| 196 |
- Add missing equivalent of ``_Py_RestoreSignals()`` call in ``fork_exec`` |
| 197 |
- Catch exceptions in ``atexit`` functions to avoid crashing the interpreter at |
| 198 |
shutdown |
| 199 |
- Update ``fast2locals`` to deal with the fact that it's now possible to |
| 200 |
delete cell vars (was forbidden in Python2) (issue 3656_) |
| 201 |
- Allow hashing memoryviews (issue 2756_) |
| 202 |
|
| 203 |
Python 3.7+ speedups and enhancements |
| 204 |
------------------------------------- |
| 205 |
|
| 206 |
- Use buffer pinning to improve CFFI-based ``_ssl`` performance |
| 207 |
- Add a fast path in the parser for unicode literals with no ``\\`` escapes |
| 208 |
- In glibc ``mbstowcs()`` can return values above 0x10ffff (bpo35883_) |
| 209 |
- Speed up ``new_interned_str`` by using better caching detection |
| 210 |
- When building a class, make sure to use a specialized ``moduledict``, not a |
| 211 |
regular empty dict |
| 212 |
- Implement ``_opcode.stack_effect`` |
| 213 |
- Share more ``W_UnicodeObject`` prebuilt instances, shrink the binary by over 1MB |
| 214 |
- Fix the ctypes errcheck_ protocol |
| 215 |
- Various fixes in the windows-only ``_overlapped`` module (issue 3625_) |
| 216 |
- Implement ``-X utf8`` |
| 217 |
- Add ``WITH_DYLD`` to ``sysconfig`` for darwin |
| 218 |
|
| 219 |
Python 3.7 C-API |
| 220 |
~~~~~~~~~~~~~~~~ |
| 221 |
|
| 222 |
- Added ``PyDescr_NewGetSet``, ``PyModule_NewObject``, ``PyModule_ExecDef``, |
| 223 |
``PyCodec_Decode``, ``PyCodec_Encode``, ``PyErr_WarnExplicit``, |
| 224 |
``PyDateTime_TimeZone_UTC``, ``PyUnicode_DecodeLocaleAndSize`` |
| 225 |
- Fix segfault when using format strings in ``PyUnicode_FromFormat`` and |
| 226 |
``PyErr_Format`` (issue 3593_) |
| 227 |
- ``_PyObject_LookupAttrId`` does not raise ``AttributeError`` |
| 228 |
- Fix cpyext implementation of ``contextvars.get`` |
| 229 |
- Deprecate ``PyPy.h``, mention the contents in the embedding docs (issue 3608_) |
| 230 |
- Remove duplicate definition of ``Py_hash_t``, document diff to CPython (issue 3612_) |
| 231 |
- Fix overflow error message when converting Python ``int`` to C ``int`` |
| 232 |
- Alias ``PyDateTime_DATE_GET_FOLD``, which CPython uses instead of the |
| 233 |
documented ``PyDateTime_GET_FOLD`` (issue 3627_) |
| 234 |
- Add some ``_PyHASH*`` macros (issue 3590_) |
| 235 |
- Fix signature of ``PyUnicode_DecodeLocale`` (issue 3661_) |
| 236 |
|
| 237 |
Python 3.8+ bugfixes |
| 238 |
-------------------- |
| 239 |
- Unwrapping an unsigned short raises ``ValueError`` on negative numbers |
| 240 |
- Make properties unpicklable |
| 241 |
- When packaging, fix finding dependencies of shared objects for portable |
| 242 |
builds and fix location of tcl/tk runtimes (issue 3616_). Also ignore |
| 243 |
``__pycache__`` directories. |
| 244 |
- Match CPython errors in ``_io.open`` and ``socket.socket(fileno=fileno)`` |
| 245 |
- Add ``LDFLAGS`` to ``sysconfig`` values |
| 246 |
- PyPy reports the IPv6 scope ID in ``getaddrinfo`` where CPython does not. Fix |
| 247 |
stdlib tests to allow PyPy's ``__repr__``. bpo35545_ touches on this. (issue |
| 248 |
3628_) |
| 249 |
- Fix small bugs when raising errors in various stdlib modules that caused |
| 250 |
stdlib test failures |
| 251 |
- Update bundled ``setuptools`` to ``58.1.0`` to get the fix for the new PyPy |
| 252 |
layout |
| 253 |
- Fix ``multiprocessing.sharedmemory`` on windows (issue 3678_). |
| 254 |
|
| 255 |
Python 3.8+ speedups and enhancements |
| 256 |
------------------------------------- |
| 257 |
- Implement reversed items and values iterator pickling, fix reversed keys |
| 258 |
iterator pickling |
| 259 |
- Add more auditing events, while skipping CPython-specific tracing and |
| 260 |
attribute-modification tracing |
| 261 |
- Fixed a speed regression when JITting empty list comprehensions (issue |
| 262 |
3598_) |
| 263 |
- Make sure that all bytecodes that can close a loop go via ``jump_absolute``, |
| 264 |
so the JIT can trace them |
| 265 |
|
| 266 |
Python 3.8 C-API |
| 267 |
~~~~~~~~~~~~~~~~ |
| 268 |
- Add ``exports.h`` and refactor headers to more closely follow CPython |
| 269 |
- ``PyLong_AsLong`` tries ``__index__`` first (issue 3585_) |
| 270 |
- Redo ``PyTypeObject`` to be able to use the ``tp_vectorcall`` slot without |
| 271 |
changing ABI compatibility (issue 3618_) by appropriating the PyPy-only |
| 272 |
``tp_pypy_flags`` slot. Users should upgrade Cython to 0.2.26 to avoid a |
| 273 |
compiler warning. |
| 274 |
- Add ``PyCompilerFlags.cf_feature_version`` (bpo35766_) |
| 275 |
- Distinguish between a C-API ``CMethod`` and an app-level ``Method``, which |
| 276 |
is important for obscure reasons |
| 277 |
|
| 278 |
.. _2756: https://foss.heptapod.net/pypy/pypy/-/issues/2756 |
| 279 |
.. _3589: https://foss.heptapod.net/pypy/pypy/-/issues/3589 |
| 280 |
.. _3584: https://foss.heptapod.net/pypy/pypy/-/issues/3584 |
| 281 |
.. _3598: https://foss.heptapod.net/pypy/pypy/-/issues/3598 |
| 282 |
.. _3585: https://foss.heptapod.net/pypy/pypy/-/issues/3585 |
| 283 |
.. _3590: https://foss.heptapod.net/pypy/pypy/-/issues/3590 |
| 284 |
.. _3593: https://foss.heptapod.net/pypy/pypy/-/issues/3593 |
| 285 |
.. _3604: https://foss.heptapod.net/pypy/pypy/-/issues/3604 |
| 286 |
.. _3608: https://foss.heptapod.net/pypy/pypy/-/issues/3608 |
| 287 |
.. _3612: https://foss.heptapod.net/pypy/pypy/-/issues/3612 |
| 288 |
.. _3616: https://foss.heptapod.net/pypy/pypy/-/issues/3616 |
| 289 |
.. _3617: https://foss.heptapod.net/pypy/pypy/-/issues/3617 |
| 290 |
.. _3618: https://foss.heptapod.net/pypy/pypy/-/issues/3618 |
| 291 |
.. _3623: https://foss.heptapod.net/pypy/pypy/-/issues/3623 |
| 292 |
.. _3624: https://foss.heptapod.net/pypy/pypy/-/issues/3624 |
| 293 |
.. _3625: https://foss.heptapod.net/pypy/pypy/-/issues/3625 |
| 294 |
.. _3628: https://foss.heptapod.net/pypy/pypy/-/issues/3628 |
| 295 |
.. _3627: https://foss.heptapod.net/pypy/pypy/-/issues/3627 |
| 296 |
.. _3630: https://foss.heptapod.net/pypy/pypy/-/issues/3630 |
| 297 |
.. _3644: https://foss.heptapod.net/pypy/pypy/-/issues/3644 |
| 298 |
.. _3642: https://foss.heptapod.net/pypy/pypy/-/issues/3642 |
| 299 |
.. _3652: https://foss.heptapod.net/pypy/pypy/-/issues/3652 |
| 300 |
.. _3650: https://foss.heptapod.net/pypy/pypy/-/issues/3650 |
| 301 |
.. _3656: https://foss.heptapod.net/pypy/pypy/-/issues/3656 |
| 302 |
.. _3661: https://foss.heptapod.net/pypy/pypy/-/issues/3661 |
| 303 |
.. _3676: https://foss.heptapod.net/pypy/pypy/-/issues/3676 |
| 304 |
.. _3678: https://foss.heptapod.net/pypy/pypy/-/issues/3678 |
| 305 |
.. _3682: https://foss.heptapod.net/pypy/pypy/-/issues/3682 |
| 306 |
.. _bpo35883: https://bugs.python.org/issue35883 |
| 307 |
.. _bpo44954: https://bugs.python.org/issue44954 |
| 308 |
.. _bpo40780: https://bugs.python.org/issue40780 |
| 309 |
.. _bpo35766: https://bugs.python.org/issue35766 |
| 310 |
.. _bpo43522: https://bugs.python.org/issue43522 |
| 311 |
.. _bpo35545: https://bugs.python.org/issue35545 |
| 312 |
.. _errcheck: https://docs.python.org/3/library/ctypes.html#ctypes._FuncPtr.errcheck |
| 313 |
.. _`speed regression`: https://foss.heptapod.net/pypy/pypy/-/issues/3649 |