Debian Codegraph @

pypy/doc/whatsnew-pypy2-5.7.0.rst

raw
1 =========================
2 What's new in PyPy2.7 5.7
3 =========================
4
5 .. this is a revision shortly after release-pypy2.7-v5.6
6 .. startrev: 7e9787939641
7
8
9 Since a while now, PyPy preserves the order of dictionaries and sets.
10 However, the set literal syntax ``{x, y, z}`` would by mistake build a
11 set with the opposite order: ``set([z, y, x])``. This has been fixed.
12 Note that CPython is inconsistent too: in 2.7.12, ``{5, 5.0}`` would be
13 ``set([5.0])``, but in 2.7.trunk it is ``set([5])``. PyPy's behavior
14 changed in exactly the same way because of this fix.
15
16
17 .. branch: mappingproxy
18 .. branch: py3k-finish_time
19 .. branch: py3k-kwonly-builtin
20 .. branch: py3k_add_terminal_size
21 .. branch: testing-cleanup-py3k
22
23 .. branch: rpython-resync
24 Backport rpython changes made directly on the py3k and py3.5 branches.
25
26 .. branch: rpython-error-to-systemerror
27
28 Any uncaught RPython exception (from a PyPy bug) is turned into an
29 app-level SystemError. This should improve the lot of users hitting an
30 uncaught RPython error.
31
32 .. branch: union-side-effects-2
33
34 Try to improve the consistency of RPython annotation unions.
35
36 .. branch: pytest-2.9.2
37
38 .. branch: clean-exported-state
39
40 Clean-ups in the jit optimizeopt
41
42 .. branch: conditional_call_value_4
43
44 Add jit.conditional_call_elidable(), a way to tell the JIT "conditionally
45 call this function" returning a result.
46
47 .. branch: desc-specialize
48
49 Refactor FunctionDesc.specialize() and related code (RPython annotator).
50
51 .. branch: raw-calloc
52
53 .. branch: issue2446
54
55 Assign ``tp_doc`` to the new TypeObject's type dictionary ``__doc__`` key
56 so it will be picked up by app-level objects of that type
57
58 .. branch: cling-support
59
60 Module cppyy now uses cling as its backend (Reflex has been removed). The
61 user-facing interface and main developer tools (genreflex, selection files,
62 class loader, etc.) remain the same. A libcppyy_backend.so library is still
63 needed but is now available through PyPI with pip: PyPy-cppyy-backend.
64
65 The Cling-backend brings support for modern C++ (11, 14, etc.), dynamic
66 template instantiations, and improved integration with CFFI for better
67 performance. It also provides interactive C++ (and bindings to that).
68
69 .. branch: better-PyDict_Next
70
71 Improve the performance of ``PyDict_Next``. When trying ``PyDict_Next`` on a
72 typedef dict, the test exposed a problem converting a ``GetSetProperty`` to a
73 ``PyGetSetDescrObject``. The other direction seem to be fully implemented.
74 This branch made a minimal effort to convert the basic fields to avoid
75 segfaults, but trying to use the ``PyGetSetDescrObject`` will probably fail.
76
77 .. branch: stdlib-2.7.13
78
79 Updated the implementation to match CPython 2.7.13 instead of 2.7.13.
80
81 .. branch: issue2444
82
83 Fix ``PyObject_GetBuffer`` and ``PyMemoryView_GET_BUFFER``, which leaked
84 memory and held references. Add a finalizer to CPyBuffer, add a
85 PyMemoryViewObject with a PyBuffer attached so that the call to
86 ``PyMemoryView_GET_BUFFER`` does not leak a PyBuffer-sized piece of memory.
87 Properly call ``bf_releasebuffer`` when not ``NULL``.
88
89 .. branch: boehm-rawrefcount
90
91 Support translations of cpyext with the Boehm GC (for special cases like
92 revdb).
93
94 .. branch: strbuf-as-buffer
95
96 Implement StringBuffer.get_raw_address (missing feature for the buffer protocol).
97 More generally it is now possible to obtain the address of any object (if it
98 is readonly) without pinning it.
99
100 .. branch: cpyext-cleanup
101 .. branch: api_func-refactor
102
103 Refactor cpyext initialisation.
104
105 .. branch: cpyext-from2
106
107 Fix a test failure introduced by strbuf-as-buffer
108
109 .. branch: cpyext-FromBuffer
110
111 Do not recreate the object in PyMemoryView_FromBuffer, rather pass it to
112 the returned PyMemoryViewObject, to take ownership of it. Fixes a ref leak.
113
114 .. branch: issue2464
115
116 Give (almost?) all GetSetProperties a valid __objclass__.
117
118 .. branch: TreeStain/fixed-typo-line-29-mostly-to-most-1484469416419
119 .. branch: TreeStain/main-lines-changed-in-l77-l83-made-para-1484471558033
120
121 .. branch: missing-tp_new
122
123 Improve mixing app-level classes in c-extensions, especially if the app-level
124 class has a ``tp_new`` or ``tp_dealloc``. The issue is that c-extensions expect
125 all the method slots to be filled with a function pointer, where app-level will
126 search up the mro for an appropriate function at runtime. With this branch we
127 now fill many more slots in the c-extenion type objects.
128 Also fix for c-extension type that calls ``tp_hash`` during initialization
129 (str, unicode types), and fix instantiating c-extension types from built-in
130 classes by enforcing an order of instaniation.
131
132 .. branch: rffi-parser-2
133
134 rffi structures in cpyext can now be created by parsing simple C headers.
135 Additionally, the cts object that holds the parsed information can act like
136 cffi's ffi objects, with the methods cts.cast() and cts.gettype().
137
138 .. branch: rpython-hash
139
140 Don't freeze hashes in the translated pypy. In practice, that means
141 that we can now translate PyPy with the option --hash=siphash24 and get
142 the same hashes as CPython 3.5, which can be randomized (in a
143 crypographically good way). It is the default in PyPy3. The default of
144 PyPy2 remains unchanged: there are user programs out there that depend
145 on constant hashes (or even sometimes on specific hash results).
146
147 .. branch: dict-move-to-end
148
149 Our dicts, which are always ordered, now have an extra "method" for
150 Python 3.x which moves an item to first or last position. In PyPy 3.5
151 it is the standard ``OrderedDict.move_to_end()`` method, but the
152 behavior is also available on Python 2.x or for the ``dict`` type by
153 calling ``__pypy__.move_to_end(dict, key, last=True)``.
154
155
156 .. branch optinfo-into-bridges-3
157
158 Improve the optimization of branchy Python code by retaining more information
159 across failing guards.
160
161
162 .. branch: space-newtext
163
164 Internal refactoring of ``space.wrap()``, which is now replaced with
165 explicitly-typed methods. Notably, there are now ``space.newbytes()``
166 and ``space.newtext()``: these two methods are identical on PyPy 2.7 but
167 not on PyPy 3.x. The latter is used to get an app-level unicode string
168 by decoding the RPython string, assumed to be utf-8.
169
170 .. branch: space-wrap
171
172 .. branch: fix_bool_restype
173
174 Fix for ``ctypes.c_bool``-returning ctypes functions
175
176 .. branch: py3.5-text-utf8
177
178 space.text_w now encodes to utf-8 not preserving surrogates.
179
180 .. branch: fix-cpyext-releasebuffer
181
182 Improve handling of the Py3-style buffer slots in cpyext: fix memoryviews
183 keeping objects alive forever (missing decref), and make sure that
184 bf_releasebuffer is called when it should, e.g. from PyBuffer_Release.
185
186 .. branch: fix-global
187
188 Fix bug (bad reported info) when asked to translate SyntaxWarning to
189 SyntaxError.
190
191 .. branch: optinfo-into-bridges-3
192
193 Improve the optimization of branchy Python code by retaining more
194 information across failing guards. This is done by appending some
195 carefully encoded extra information into the resume code.
196
197 .. branch: shadowstack-perf-2
198
199 Two changes that together bring the performance of shadowstack close to
200 asmgcc---close enough that we can now make shadowstack the default even
201 on Linux. This should remove a whole class of rare bugs introduced by
202 asmgcc.
203
204 .. branch: fniephaus/fix-typo-1488123166752