Debian Codegraph @

pypy/doc/release-v5.9.0.rst

raw
1 =====================================
2 PyPy2.7 and PyPy3.5 v5.9 dual release
3 =====================================
4
5 The PyPy team is proud to release both PyPy2.7 v5.9 (an interpreter supporting
6 Python 2.7 syntax), and a beta-quality PyPy3.5 v5.9 (an interpreter for Python
7 3.5 syntax). The two releases are both based on much the same codebase, thus
8 the dual release. Note that PyPy3.5 supports Linux 64bit only for now.
9
10 This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
11 PyPy3.5 includes the upstream stdlib version 3.5.3.
12
13 NumPy and Pandas now work on PyPy2.7 (together with Cython 0.27.1). Issues
14 that appeared as excessive memory
15 use were cleared up and other incompatibilities were resolved. The C-API
16 compatibility layer does slow down code which crosses the python-c interface
17 often, we have ideas on how it could be improved, and still recommend
18 using pure python on PyPy or interfacing via CFFI_. Many other modules
19 based on C-API exentions now work on PyPy as well.
20
21 Cython 0.27.1 (released very recently) supports more projects with PyPy, both
22 on PyPy2.7 and PyPy3.5 beta. Note version **0.27.1** is now the minimum
23 version that supports this version of PyPy, due to some interactions with
24 updated C-API interface code.
25
26 We optimized the JSON parser for recurring string keys, which should decrease
27 memory use to 50% and increase parsing speed by up to 15% for large JSON files
28 with many repeating dictionary keys (which is quite common).
29
30 CFFI_, which is part of the PyPy release, has been updated to 1.11.1,
31 improving an already great package for interfacing with C. CFFI now supports
32 complex arguments in API mode, as well as ``char16_t`` and ``char32_t`` and has
33 improved support for callbacks.
34
35 Please let us know if your use case is slow, we have ideas how to make things
36 faster but need real-world examples (not micro-benchmarks) of problematic code.
37
38 Work sponsored by a Mozilla grant_ continues on PyPy3.5; numerous fixes from
39 CPython were ported to PyPy. Of course the bug fixes and performance enhancements
40 mentioned above are part of both PyPy2.7 and PyPy3.5 beta.
41
42 As always, this release fixed many other issues and bugs raised by the
43 growing community of PyPy users. We strongly recommend updating.
44
45 You can download the v5.9 releases here:
46
47 https://pypy.org/download.html
48
49 We would like to thank our donors for the continued support of the PyPy
50 project.
51
52 We would also like to thank our contributors and
53 encourage new people to join the project. PyPy has many
54 layers and we need help with all of them: `PyPy`_ and `RPython`_ documentation
55 improvements, tweaking popular `modules`_ to run on pypy, or general `help`_
56 with making RPython's JIT even better.
57
58 .. _vmprof: https://vmprof.readthedocs.io
59 .. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html
60 .. _grant: https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html
61 .. _`PyPy`: index.html
62 .. _`RPython`: https://rpython.readthedocs.org
63 .. _`modules`: project-ideas.html#make-more-python-modules-pypy-friendly
64 .. _`help`: project-ideas.html
65
66 What is PyPy?
67 =============
68
69 PyPy is a very compliant Python interpreter, almost a drop-in replacement for
70 CPython 2.7 and CPython 3.5. It's fast (`PyPy and CPython 2.7.x`_ performance comparison)
71 due to its integrated tracing JIT compiler.
72
73 We also welcome developers of other `dynamic languages`_ to see what RPython
74 can do for them.
75
76 The PyPy 2.7 release supports:
77
78 * **x86** machines on most common operating systems
79 (Linux 32/64 bits, Mac OS X 64 bits, Windows 32 bits, OpenBSD, FreeBSD)
80
81 * newer **ARM** hardware (ARMv6 or ARMv7, with VFPv3) running Linux,
82
83 * big- and little-endian variants of **PPC64** running Linux,
84
85 * **s390x** running Linux
86
87 .. _`PyPy and CPython 2.7.x`: https://speed.pypy.org
88 .. _`dynamic languages`: https://rpython.readthedocs.io/en/latest/examples.html
89
90 Highlights of the PyPy2.7, cpyext, and RPython changes (since 5.8 released June, 2017)
91 ======================================================================================
92
93 See also issues that were resolved_
94
95 Note that these are also merged into PyPy 3.5
96
97 * New features and cleanups
98
99 * Add support for ``PyFrozenSet_New``, ``PyObject_HashNotImplemented``,
100 ``PyObject_Print(NULL, ...)``, ``PyObject_RichCompareBool(a, a, ...)``,
101 ``PyType_IS_GC`` (does nothing), ``PyUnicode_FromFormat``
102 * ctypes ``char_p`` and ``unichar_p`` indexing now CPython compatible
103 * ``gcdump`` now reports largest object
104 * More complete support in the ``_curses`` CFFI module
105 * Add cPickle.Unpickler.find_global (issue 1853_)
106 * Fix ``PyErr_Fetch`` + ``PyErr_NormalizeException`` with no exception set
107 * Simplify ``gc.get_referrers()`` to return the opposite of ``gc.get_referents()``
108 * Update RevDB to version pypy2.7-v5.6.2
109 * Previously, ``instance.method`` would return always the same bound method
110 object, when gotten from the same instance (as far as ``is`` and ``id()``
111 can tell). CPython doesn't do that. Now PyPy, like CPython, returns a
112 different bound method object every time. For ``type.method``, PyPy2 still
113 returns always the same *unbound* method object; CPython does it for built-in
114 types but not for user-defined types
115 * Link to disable PaX protection for the JIT when needed
116 * Update build instructions and an rarely used Makefile
117 * Recreate support for using leakfinder in cpyext tests which had suffered
118 bit-rot, disable due to many false positives
119 * Add more functionality to ``sysconfig``
120 * Added ``_swappedbytes_`` support for ``ctypes.Structure``
121 * Better support the ``inspect`` module on ``frames``
122
123 * Bug Fixes
124
125 * Fix issue 2592_ - cpyext ``PyListObject.pop``, ``pop_end`` must return a value
126 * Implement ``PyListOjbect.getstorage_copy``
127 * Fix for ``reversed(dictproxy)`` issue 2601_
128 * Fix for duplicate names in ctypes' ``_fields__``, issue 2621_
129 * Update built-in ``pyexpat`` module on win32 to use UTF-8 version not UTF-16
130 * ``gc.get_objects`` now handles objects with finalizers more consistently
131 * Fixed memory leak in ``SSLContext.getpeercert`` returning validated
132 certificates and ``SSLContext.get_ca_certs(binary_mode=True)``
133 (_get_crl_dp) `CPython issue 29738`_
134
135 * Performance improvements:
136
137 * Improve performance of ``bytearray.extend`` by rewriting portions in app-level
138 * Optimize list accesses with constant indexes better by retaining more
139 information about them
140 * Add a jit driver for ``array.count`` and ``array.index``
141 * Improve information retained in a bridge wrt ``array``
142 * Move some dummy CAPI functions and ``Py*_Check`` functions from RPython into
143 pure C macros
144 * In the fast ``zip(intlist1, intlist2)`` implementation, don't wrap and unwrap
145 all the ints
146 * Cache string keys that occur in JSON dicts, as they are likely to repeat
147
148 * RPython improvements
149
150 * Do not preallocate a RPython list if we only know an upper bound on its size
151 * Issue 2590_: fix the bounds in the GC when allocating a lot of objects with finalizers
152 * Replace magical NOT RPYTHON comment with a decorator
153 * Implement ``socket.sendmsg()``/``.recvmsg()`` for py3.5
154 * Add ``memory_pressure`` for ``_SSLSocket`` objects
155
156 * Degredations
157
158 * Disable vmprof on win32, due to upstream changes that break the internal ``_vmprof`` module
159
160 .. _here: cpython_differences.html
161 .. _1853: https://bitbucket.org/pypy/pypy/issues/1853
162 .. _2592: https://bitbucket.org/pypy/pypy/issues/2592
163 .. _2590: https://bitbucket.org/pypy/pypy/issues/2590
164 .. _2621: https://bitbucket.org/pypy/pypy/issues/2621
165
166 Highlights of the PyPy3.5 release (since 5.8 beta released June 2017)
167 ======================================================================
168
169 * New features
170
171 * Add support for ``_PyNamespace_New``, ``PyMemoryView_FromMemory``,
172 ``Py_EnterRecursiveCall`` raising RecursionError, ``PyObject_LengthHint``,
173 ``PyUnicode_FromKindAndData``, ``PyDict_SetDefault``, ``PyGenObject``,
174 ``PyGenObject``, ``PyUnicode_Substring``, ``PyLong_FromUnicodeObject``
175 * Implement ``PyType_FromSpec`` (PEP 384) and fix issues with PEP 489 support
176 * Support the new version of ``os.stat()`` on win32
177 * Use ``stat3()`` on Posix
178 * Accept buffer objects as filenames, except for `oslistdir``
179 * Make slices of array ``memoryview`` s usable as writable buffers if contiguous
180 * Better handling of ``'%s'`` formatting for byte strings which might be utf-8 encoded
181 * Update the macros ``Py_DECREF`` and similar to use the CPython 3.5 version
182 * Ensure that ``mappingproxy`` is recognised as a mapping, not a sequence
183 * Enable PGO for CLang
184 * Rework ``cppyy`` packaging and rename the backend to ``_cppyy``
185 * Support for libressl 2.5.4
186 * Mirror CPython ``classmethod __reduce__`` which fixes pickling test
187 * Use utf-8 for ``readline`` history file
188 * Allow assigning ``'__class__'`` between ``ModuleType`` and its subclasses
189 * Add async slot functions in cpyext
190
191 * Bug Fixes
192
193 * Try to make ``openssl`` CFFI bindings more general and future-proof
194 * Better support ``importlib`` by only listing built-in modules in ``sys.builtin``
195 * Add ``memory_pressure`` to large CFFI allocations in ``_lzma``, issue 2579_
196 * Fix for ``reversed(mapping object)`` issue 2601_
197 * Fixing regression with non-started generator receiving non-``None``, should
198 always raise ``TypeError``
199 * ``itertools.islice``: use same logic as CPython, fixes 2643_
200
201 * Performance improvements:
202
203 *
204
205 * The following features of Python 3.5 are not implemented yet in PyPy:
206
207 * PEP 442: Safe object finalization
208
209 .. _resolved: whatsnew-pypy2-5.9.0.html
210 .. _2579: https://bitbucket.org/pypy/pypy/issues/2579
211 .. _2601: https://bitbucket.org/pypy/pypy/issues/2601
212 .. _2643: https://bitbucket.org/pypy/pypy/issues/2643
213 .. _CPython issue 29738: https://bugs.python.org/issue29738
214
215 Please update, and continue to help us make PyPy better.
216
217 Cheers