Debian Codegraph @

pypy/doc/release-v7.3.1.rst

raw
1 ========================================================
2 PyPy v7.3.1: release of 2.7 and 3.6, released 2020-04-10
3 ========================================================
4
5 The PyPy team is proud to release the version 7.3.1 of PyPy, which includes
6 two 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 The interpreters are based on much the same codebase, thus the multiple
15 release. This is a micro release, no APIs have changed since the 7.3.0 release
16 in December, but read on to find out what is new.
17
18 Conda Forge now `supports PyPy`_ as a python interpreter. The support right now
19 is being built out. After this release, many more c-extension-based
20 packages can be successfully built and uploaded. This is the result of a lot of
21 hard work and good will on the part of the Conda Forge team. A big shout out
22 to them for taking this on.
23
24 We have worked with the python packaging group to support tooling around
25 building third party packages for python, so this release updates the pip and
26 setuptools installed when executing ``pypy -mensurepip`` to ``pip>=20``. This
27 completes the work done to update the PEP 425 `python tag`_ from ``pp373`` to
28 mean "PyPy 7.3 running python3" to ``pp36`` meaning "PyPy running python
29 3.6" (the format is recommended in the PEP). The tag itself was
30 changed in 7.3.0, but older pip versions build their own tag without querying
31 pypy. This means that wheels built for the previous tag format will not be
32 discovered by pip from this version, so library authors should update their
33 PyPY-specific wheels on PyPI.
34
35 Development of PyPy is transitioning to https://foss.heptapod.net/pypy/pypy.
36 This move was covered more extensively in the `blog post`_ from last month.
37
38 The `CFFI`_ backend has been updated to version 14.0. We recommend using CFFI
39 rather than c-extensions to interact with C, and using cppyy_ for performant
40 wrapping of C++ code for Python. The ``cppyy`` backend has been enabled
41 experimentally for win32, try it out and let use know how it works.
42
43 Enabling ``cppyy`` requires a more modern C compiler, so win32 is now built
44 with MSVC160 (Visual Studio 2019). This is true for PyPy 3.6 as well as for 2.7.
45
46 We have improved warmup time by up to 20%, performance of ``io.StringIO`` to
47 match if not be faster than CPython, and improved JIT code generation for
48 generators (and generator expressions in particular) when passing them to
49 functions like ``sum``, ``map``, and ``map`` that consume them.
50
51 As always, this release fixed several issues and bugs raised by the growing
52 community of PyPy users. We strongly recommend updating. Many of the fixes are
53 the direct result of end-user bug reports, so please continue reporting issues
54 as they crop up.
55
56 You can find links to download the v7.3.1 releases here:
57
58 https://pypy.org/download.html
59
60 We would like to thank our donors for the continued support of the PyPy
61 project. If PyPy is not quite good enough for your needs, we are available for
62 direct consulting work.
63
64 We would also like to thank our contributors and encourage new people to join
65 the project. PyPy has many layers and we need help with all of them: `PyPy`_
66 and `RPython`_ documentation improvements, tweaking popular modules to run
67 on pypy, or general `help`_ with making RPython's JIT even better. Since the
68 previous release, we have accepted contributions from 13 new contributors,
69 thanks for pitching in.
70
71 If you are a python library maintainer and use c-extensions, please consider
72 making a cffi / cppyy version of your library that would be performant on PyPy.
73 In any case both `cibuildwheel`_ and the `multibuild system`_ support
74 building wheels for PyPy wheels.
75
76 .. _`PyPy`: index.html
77 .. _`RPython`: https://rpython.readthedocs.org
78 .. _`help`: project-ideas.html
79 .. _`CFFI`: https://cffi.readthedocs.io
80 .. _`cppyy`: https://cppyy.readthedocs.io
81 .. _`available as wheels`: https://github.com/antocuni/pypy-wheels
82 .. _`portable-pypy`: https://github.com/squeaky-pl/portable-pypy
83 .. _`docker images`: https://github.com/pypy/manylinux
84 .. _`multibuild system`: https://github.com/matthew-brett/multibuild
85 .. _`cibuildwheel`: https://github.com/joerick/cibuildwheel
86 .. _`manylinux2010`: https://github.com/pypa/manylinux
87 .. _`blog post`: https://morepypy.blogspot.com/2020/02/pypy-and-cffi-have-moved-to-heptapod.html
88 .. _ `python tag`: https://www.python.org/dev/peps/pep-0425/#python-tag
89 .. _`supports PyPy`: https://conda-forge.org/blog//2020/03/10/pypy
90
91
92 What is PyPy?
93 =============
94
95 PyPy is a very compliant Python interpreter, almost a drop-in replacement for
96 CPython 2.7, 3.6, and soon 3.7. It's fast (`PyPy and CPython 2.7.x`_ performance
97 comparison) due to its integrated tracing JIT compiler.
98
99 We also welcome developers of other `dynamic languages`_ to see what RPython
100 can do for them.
101
102 This PyPy release supports:
103
104 * **x86** machines on most common operating systems
105 (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
106
107 * big- and little-endian variants of **PPC64** running Linux,
108
109 * **s390x** running Linux
110
111 * 64-bit **ARM** machines running Linux.
112
113 Unfortunately at the moment of writing our ARM32 buildbots are out of service,
114 so for now we are **not** releasing any binaries for that architecture,
115 although PyPy does support ARM 32 bit processors.
116
117 .. _`PyPy and CPython 2.7.x`: https://speed.pypy.org
118 .. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html
119
120
121 Changelog
122 =========
123
124 Changes shared across versions
125 ------------------------------
126 - We now package and ship the script to rebuild all the stdlib helper modules
127 that on CPython are written as c-extensions and in PyPy use CFFI. These are
128 located in ``lib_pypy``, and the build script in ``lib_pypy/pypy_tools``.
129 - Implement CPython 16055_: Fixes incorrect error text for
130 ``int('1', base=1000)``.
131 - Handle NaN correctly in ``array.array``.
132 - Fix `issue 3137`_: rsplit of unicode strings that end with a non-ascii char
133 was broken
134 - Fix `issue 3140`_: add ``$dist_name`` to ``include`` path when using
135 ``setup.py install``
136 - Fix `issue 3146`_: using a jsonDict as an instance `__dict__` would segfault
137 - Fix `issue 3144`_: using `wch` in the curses CFFI module
138 - Fix `issue 3149`_ which is related to the still-open CPython issue 12029_
139 around Exceptions, metaclasses, ``__instancecheck__`` and ``__subclasscheck__``
140 - Fix a corner case in ``multibytecodec``: for stateful codecs, when encoding
141 fails and we use replacement, the replacement string must be written in the
142 output preserving the state.
143 - Correct mistake in position when handling errors in unicode formatting
144 - Add ``__rsub__``, ``__rand__`` and ``__ror__``, ``__rxor__`` operations to
145 set and frozenset objects
146 - Fix bug in locale-specific string formatting: the thousands separator was
147 always ``'.'``
148 - Fix `issue 3065`_ (again!): segfault in ``mmap``
149 - ``rstruct.runpack`` should align for next read
150 - Fix `issue 3155`_: virtualenv on win32 installs into Scripts, not bin
151 - Add Python3.6 ``socket`` constants, they will be exposed in pypy2.7 as well
152 - Use better green keys for non-standard jitdrivers to make sure that e.g.
153 generators are specialized based on their code object
154 - Improve warmup speed of PyPy by around ~5-20%
155
156 - a few minor tweaks in the interpreter
157 - since tracing guards is super costly, work harder at not emitting
158 too many guard_not_invalidated while tracing
159 - optimize quasi_immut during tracing
160 - optimize loopinvariant calls during tracing
161 - a small optimization around non-standard virtualizables during tracing
162 - Fix off-by-one error and rework system calls to ``_get_tzname`` on win32
163 - Fix `issue 3134`_: non-ascii filenames on win32
164 - Fix app-level bufferable classes, related to getting the CFFI backend to
165 pyzmq working
166 - Improve performance of ``io.StringIO()``. It should now be faster than
167 CPython in common use cases
168 - Fix bug in ``PyCode.__eq__``: the compiler contains careful logic to make
169 sure that it doesn't unify things like ``0.0`` and ``-0.0`` (they are equal,
170 but the sign still shouldn't be dropped)
171 - Speed up integer parsing with some fast paths for common cases
172 - Add ``__pypy__.utf8content`` to return the raw content of a Unicode object
173 (for debugging)
174 - Update ``pip`` and ``setuptools`` in ``ensurepip`` to 20.0.2 and 44.0.0
175 respectively
176 - Fix potential segfault in the zipimporter
177 - Fixes in the JIT backend for PowerPC
178 - Update the statically-linked openssl to 1.1.1f on macOS.
179 - Fix `re` grouprefs which were broken for unicode
180
181 C-API (cpyext) and c-extensions
182 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 - Fix more of `issue 3141`_ : use ``Py_TYPE(op)`` instead of ``(ob)->ob_type``
184 in our header files
185 - Partially resync ``pyport.h`` with CPython and add many missing constants
186 - Check for ``ferror`` when reading from a file in ``PyRun_File``
187
188 Python 3.6 only
189 ---------------
190 - Fix for CPython 30891_: deadlock import detection causes deadlocks
191 - Don't swallow the UnicodeDecodeError in one corner case (fixes issue 3132)
192 - Follow CPython's behaviour more closely in sqlite3
193 - Fix `issue 3136`: On windows, ``os.putenv()`` cannot have a key with ``'='``
194 in it.
195 - More closely follow CPython's line number output in disassembly of constants
196 - Don't give a new error message if metaclass is actually type
197 - Improve ``fcntl``'s handling of errors in functions that do not retry
198 - Re-implement ``BUILD_LIST_FROM_ARG`` as a fast path
199 - Fix `issue 3159`_: ``venv`` should copy directories, not just files
200 - Add missing ``MACOSX_DEPLOYMENT_TARGET`` to ``config_vars`` for Darwin
201 - Fix for path-as- ``memoryview`` on win32
202 - Fix `issue 3166`_: Obscure ordering-of-which-error-to-report-first
203 - Improve the performance of ``str.join``. This helps both lists (in some
204 situations) and iterators, but the latter is helped more. Some speedups of
205 >50% when using some other iterator
206 - Remove ``__PYVENV_LAUNCHER__`` from ``os.environ`` during startup on Darwin
207
208 Python 3.6 C-API
209 ~~~~~~~~~~~~~~~~
210
211 - Fix `issue 3160`_: include ``structseq.h`` in ``Python.h`` (needed for
212 ``PyStructSequence_InitType2`` in NumPy)
213 - Fix `issue 3165`_: surrogates in ``PyUnicode_FromKindAndData``
214 - Add ``PyDescr_TYPE``, ``PyDescr_NAME``.
215
216 .. _`issue 3065`: https://foss.heptapod.net/pypy/pypy/issues/3065
217 .. _`issue 3132`: https://foss.heptapod.net/pypy/pypy/issues/3132
218 .. _`issue 3134`: https://foss.heptapod.net/pypy/pypy/issues/3134
219 .. _`issue 3136`: https://foss.heptapod.net/pypy/pypy/issues/3136
220 .. _`issue 3137`: https://foss.heptapod.net/pypy/pypy/issues/3137
221 .. _`issue 3140`: https://foss.heptapod.net/pypy/pypy/issues/3140
222 .. _`issue 3141`: https://foss.heptapod.net/pypy/pypy/issues/3141
223 .. _`issue 3144`: https://foss.heptapod.net/pypy/pypy/issues/3144
224 .. _`issue 3146`: https://foss.heptapod.net/pypy/pypy/issues/3146
225 .. _`issue 3149`: https://foss.heptapod.net/pypy/pypy/issues/3149
226 .. _`issue 3155`: https://foss.heptapod.net/pypy/pypy/issues/3155
227 .. _`issue 3159`: https://foss.heptapod.net/pypy/pypy/issues/3159
228 .. _`issue 3160`: https://foss.heptapod.net/pypy/pypy/issues/3160
229 .. _`issue 3165`: https://foss.heptapod.net/pypy/pypy/issues/3165
230 .. _`issue 3166`: https://foss.heptapod.net/pypy/pypy/issues/3166
231
232 .. _12029: https://bugs.python.org/issue12029
233 .. _16055: https://bugs.python.org/issue16055
234 .. _30891: https://bugs.python.org/issue30891
235
236 .. _`python tag`: https://www.python.org/dev/peps/pep-0425/#python-tag