PyPy v7.3.10: release of python 2.7, 3.8, and 3.9¶
The PyPy team is proud to release version 7.3.10 of PyPy. We have some nice speedups and bugfixes we wish to share. The release includes three different interpreters:
- PyPy2.7, which is an interpreter supporting the syntax and the features of Python 2.7 including the stdlib for CPython 2.7.18+ (the
+
is for backported security updates)- PyPy3.8, which is an interpreter supporting the syntax and the features of Python 3.8, including the stdlib for CPython 3.8.15.
- PyPy3.9, which is an interpreter supporting the syntax and the features of Python 3.9, including the stdlib for CPython 3.9.15. We have gained confidence in the stability of this version, and are removing the “beta” label.
The interpreters are based on much the same codebase, thus the multiple release. This is a micro release, all APIs are compatible with the other 7.3 releases. Highlights of the release, since the release of 7.3.9 in March 2022 include:
- A release of Apple Silicon M1 arm64 versions. This work was sponsored by an anonymous donor and is tested on our buildbots.
- Many improvements to the basic interpreter to make it 15-20% faster
- The conda-forge community has built over 1000 packages for PyPy3.8 and 3.9, making it easier than ever to use PyPy.
- Update the packaged OpenSSL to 1.1.1s, sqlite3 to 3.39.4, and apply applicable security fixes from CPython 3.9.15 to PyPy2.7
- Update the HPy backend in PyPy3.8 and PyPy3.9 to 0.0.4
We recommend updating. You can find links to download the v7.3.10 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. If PyPy is helping you out, we would love to hear about it and encourage submissions to our blog via a pull request to https://github.com/pypy/pypy.org
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: bug fixes, PyPy and RPython documentation improvements, or general help with making RPython’s JIT even better. Since the previous release, we have accepted contributions from five new contributors, thanks for pitching in, and welcome to the project!
If you are a python library maintainer and use C-extensions, please consider making a HPy / CFFI / cppyy version of your library that would be performant on PyPy. In any case, both cibuildwheel and the multibuild system support building wheels for PyPy.
What is PyPy?¶
PyPy is a Python interpreter, a drop-in replacement for CPython 2.7, 3.8 and 3.9. It’s fast (PyPy and CPython 3.7.4 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.
We provide binary builds for:
- x86 machines on most common operating systems (Linux 32/64 bits, Mac OS 64 bits, Windows 64 bits)
- 64-bit ARM machines running Linux (
aarch64
).- Apple M1 arm64 machines (
macos_arm64
).- s390x running Linux
PyPy support Windows 32-bit, Linux PPC64 big- and little-endian, and Linux ARM 32 bit, but does not release binaries. Please reach out to us if you wish to sponsor binary releases for those platforms. Downstream packagers provide binary builds for debian, Fedora, conda, OpenBSD, FreeBSD, Gentoo, and more.
Changelog¶
Default version (2.7+)¶
Python 3.8+¶
Python 3.8+ bugfixes¶
- Fix bug in the disassembler of py3 opcodes (issue 3700)
- Raise
ModuleNotFoundError
instead ofImportError
in some cases - Fix
.lineno
,.col_offset
for decorated functions and classes - Add a
name
tosys.hash_info
- Fix concurrency problem in buffered
io
reading (issue 3729) - Make it possible to multiple-inherit from
KeyError
again (issue 3728) - Check results from _openssl’s
EVP_DigestInit_ex
andEVP_DigestUpdate
, and fix some failing tests (issue 3741) - Fix pickling of
filter
objects - Fix the way that the lookup annotation optimization breaks python3 due to the way that module instances can change their class at runtime (issue 3758)
- Use the name mapping when creating new hashes for
_hashlib
(issue 3778) - Expose
os.sendfile
on macos - Do not override PyPy’s
MAGIC_NUMBER
when usingimportlib/_bootstrap_external.py
(issue 3783) - Fix dictionary unpacking for
kwargs
(issue 3775) - Add memory pressure when creating a tkinter image (issue 3798)
- Remove debug print from
_winapi
(issue 3819) - Add
__contains__
toarray.array
type (issue 3820) - Fix CVE-2022-37454 via porting CPython changes to _sha3/kcp/KeccakSponge.inc
- Make type lookups fill the
.name
field ofAttributeError
- Check cursor lock in sqlite3
Cursor.close
, also lock around__fetch_one_row
- Implement
os.get_native_thread
- Fix setting a slice in a
memoryview
with non-unit strides (issue 3857) - Fix the
__copy__
optimization ofitertools.tee
, which was copying the iterable, not the iterator (issue 3852) - Fix
time.strftime
when theformat
contains unicode (issue 3862) - Fix
time.strftime
formatting on windows
Python 3.8+ speedups and enhancements¶
- Speed up
fstrings
by making the parentstack a resizable list of chars - Better error message when the
__iter__
of a class is set toNone
(issue 3716) - Refactor the
package.py
script for better compatibility with conda-forge - Add a jit driver for
filter
(issue 3745) - Improve opcode handling:
jump_absolute
,int_xor
, and others - Don’t make a JIT loop for one-arg
print()
- Make float hashing elidable and avoid creating bridges
- Mimic CPython’s
max_int_threshold
to limit the length of a string that that can be parsed into an int
Python 3.8+ C-API¶
- Add
PyReversed_Type
,PyUnicode_EncodeCodePage
,PyInterpreterState_GetID
,PyErr_SetFromErrnoWithFilenameObjects
,PyUnicode_Append
,PyUnicode_AppendAndDel
,PyClassMethod_Type
,PyStructSequence_SetItem
,PyStructSequence_GetItem
,PyDictValues_Type
,PyDictKeys_Type
, - Map user defined python
__init__
totp_init
(issue 2806) - Fix PyDict_Contains (issue 3742)
- Allow big ints in
PyNumber_ToBase
(issue 3765) - Normalize OSErrors more consistently, may not be completely fixed on macos (issue 3786)
- Fix
PyDict_Contains
to raise on unhashable key - Use
tp_itemsize==0
onPyUnicode_Type
, even for compact forms (issue 3772) - Include
<sys/time.h>
in headers, which fixes a problem with musl (issue 3801) - Add missing incref in
PyObject_Init
, allocatetp_basicsize
bytes when creating aPyTypeObject
(issues 3844, 3847) - Assign
tp_getset
to app-level type inPyType_FromSpecWithBases
(issue 3851) - Properly instantiate
PyFunction_Type
,PyMethod_Type
,PyRange_Type
,PyTraceBack_Type
(issue 3776)
Python 3.9+¶
Python 3.9+ bugfixes¶
- Fix
f-string
bug where the recursive tokenization was done incorrectly (issue 3751) - Fixes to
repr
and slots of nestedGenericAliases
(issue 3720) - Match CPython error messages for zip when
strict=True
(this is a backported 3.10 feature). - Add
BASE_TYPE_ADAPTION
optimization to sqlite3, copied from CPython’s approach - Make
__file__
of the__main__
module be an absolute path, if possible (issue 3766) - Use an absolute path for the main module (issue 3792)
- Use an absolute path for
sys.path[0]
when running a directory from the cmdline (issue 3792) - Fix first line number of
eval
to be reported as 0 (issue 3800) - Implement
bitcount
for ints - Check when unmarshalling
TYPE_SHORT_ASCII
that non-ascii bytes are not present - Fix CVE-2022-42919 (str -> int parsing) as CPython did in cpython-97514
- Fix
DICT_MERGE
bytecode with objects that aren’t dicts and don’t implement__len__
(issue 3841) - Remove redundant pure-python
_functools.py
(issue 3861) - Fix pure-python
functools.py
from CPython (CPython uses a c-extension)
Python 3.9+ speedups and enhancements¶
- Adopt CPython changes to speed up fractions (issue 3746, cpython-91851)
- Speed up
math.perm
andmath.comb
(issue 3859)