Author: Richard Plangger <[email protected]>
Branch: s390x-backend
Changeset: r82832:b31ac68c3821
Date: 2016-03-06 21:35 +0100
http://bitbucket.org/pypy/pypy/changeset/b31ac68c3821/
Log: catchup with default
diff --git a/pypy/doc/release-5.0.0.rst b/pypy/doc/release-5.0.0.rst
--- a/pypy/doc/release-5.0.0.rst
+++ b/pypy/doc/release-5.0.0.rst
@@ -1,8 +1,8 @@
-==========
-PyPy 5.0.0
-==========
+========
+PyPy 5.0
+========
-We have released PyPy 5.0.0, about three months after PyPy 4.0.0.
+We have released PyPy 5.0, about three months after PyPy 4.0.1.
We encourage all users of PyPy to update to this version. Apart from the usual
bug fixes, there is an ongoing effort to improve the warmup time and memory
usage of JIT-related metadata. The exact effects depend vastly on the program
@@ -18,7 +18,7 @@
now just works on MacOS and Windows too, in both PyPy (built-in support) and
CPython (as an installed module).
-You can download the PyPy 5.0.0 release here:
+You can download the PyPy 5.0 release here:
http://pypy.org/download.html
@@ -35,7 +35,7 @@
====
While not applicable only to PyPy, `cffi`_ is arguably our most significant
-contribution to the python ecosystem. PyPy 5.0.0 ships with
+contribution to the python ecosystem. PyPy 5.0 ships with
`cffi-1.5.2`_ which now allows embedding PyPy (or cpython) in a c program.
.. _`PyPy`: http://doc.pypy.org
@@ -98,7 +98,8 @@
* Bug Fixes
- * Backport always using os.urandom for uuid4 from cpython
+ * Backport always using os.urandom for uuid4 from cpython and fix the JIT as
well
+ (issue #2202)
* More completely support datetime, optimize timedelta creation
@@ -106,7 +107,7 @@
generated by the unroller, appeared in a complicated DJango app
* Fix an elusive issue with stacklets on shadowstack which showed up when
- forgetting stacklets without resuming them
+ forgetting stacklets without resuming them
* Fix entrypoint() which now acquires the GIL
@@ -146,13 +147,13 @@
* Support indexing filtering with a boolean ndarray
+ * Support partition() as an app-level function, together with a cffi wrapper
+ in pypy/numpy, this now provides partial support for partition()
+
* Performance improvements and refactorings:
* Refactor and improve exception analysis in the annotator
- * Improve the performace of struct.unpack; unpacking of floats and doubles
- is now about 15 times faster and 64 bit integers faster by a factor of 2
-
* Remove unnecessary special handling of space.wrap().
* Improve the memory signature of numbering instances in the JIT. This should
diff --git a/pypy/doc/whatsnew-5.0.0.rst b/pypy/doc/whatsnew-5.0.0.rst
--- a/pypy/doc/whatsnew-5.0.0.rst
+++ b/pypy/doc/whatsnew-5.0.0.rst
@@ -1,6 +1,6 @@
-=========================
-What's new in PyPy 5.0.+
-=========================
+======================
+What's new in PyPy 5.0
+======================
.. this is a revision shortly after release-4.0.1
.. startrev: 4b5c840d0da2
@@ -128,6 +128,7 @@
Fix SSL tests by importing cpython's patch
+
.. branch: remove-getfield-pure
Remove pure variants of ``getfield_gc_*`` operations from the JIT. Relevant
@@ -189,3 +190,8 @@
.. branch: ndarray-setitem-filtered
Fix boolean-array indexing in micronumpy
+
+.. branch: numpy_partition
+Support ndarray.partition() as an app-level function numpy.core._partition_use,
+provided as a cffi wrapper to upstream's implementation in the pypy/numpy repo
+
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -2,8 +2,8 @@
What's new in PyPy 5.0.+
=========================
-.. this is a revision shortly after release-5.0.0
-.. startrev: 6d13e55b962a
+.. this is a revision shortly after release-5.0
+.. startrev: 7bb6381d084c
.. branch: memop-simplify3
diff --git a/pypy/module/micronumpy/appbridge.py
b/pypy/module/micronumpy/appbridge.py
--- a/pypy/module/micronumpy/appbridge.py
+++ b/pypy/module/micronumpy/appbridge.py
@@ -9,6 +9,7 @@
w_array_repr = None
w_array_str = None
w__usefields = None
+ w_partition = None
def __init__(self, space):
pass
diff --git a/pypy/module/micronumpy/ndarray.py
b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -557,8 +557,12 @@
return self.get_scalar_value().item(space)
l_w = []
for i in range(self.get_shape()[0]):
- l_w.append(space.call_method(self.descr_getitem(space,
- space.wrap(i)), "tolist"))
+ item_w = self.descr_getitem(space, space.wrap(i))
+ if (isinstance(item_w, W_NDimArray) or
+ isinstance(item_w, boxes.W_GenericBox)):
+ l_w.append(space.call_method(item_w, "tolist"))
+ else:
+ l_w.append(item_w)
return space.newlist(l_w)
def descr_ravel(self, space, w_order=None):
@@ -934,6 +938,10 @@
return
return self.implementation.sort(space, w_axis, w_order)
+ def descr_partition(self, space, __args__):
+ return get_appbridge_cache(space).call_method(
+ space, 'numpy.core._partition_use', 'partition',
__args__.prepend(self))
+
def descr_squeeze(self, space, w_axis=None):
cur_shape = self.get_shape()
if not space.is_none(w_axis):
@@ -1658,6 +1666,7 @@
argsort = interp2app(W_NDimArray.descr_argsort),
sort = interp2app(W_NDimArray.descr_sort),
+ partition = interp2app(W_NDimArray.descr_partition),
astype = interp2app(W_NDimArray.descr_astype),
base = GetSetProperty(W_NDimArray.descr_get_base),
byteswap = interp2app(W_NDimArray.descr_byteswap),
diff --git a/pypy/module/micronumpy/test/test_ndarray.py
b/pypy/module/micronumpy/test/test_ndarray.py
--- a/pypy/module/micronumpy/test/test_ndarray.py
+++ b/pypy/module/micronumpy/test/test_ndarray.py
@@ -1958,6 +1958,22 @@
a = array([[1, 2], [3, 4]])
assert (a + a).tolist() == [[2, 4], [6, 8]]
+ def test_tolist_object(self):
+ from numpy import array
+ a = array([0], dtype=object)
+ assert a.tolist() == [0]
+
+ def test_tolist_object_slice(self):
+ from numpy import array
+ list_expected = [slice(0, 1), 0]
+ a = array(list_expected, dtype=object)
+ assert a.tolist() == list_expected
+
+ def test_tolist_object_slice_2d(self):
+ from numpy import array
+ a = array([(slice(0, 1), 1), (0, 1)], dtype=object)
+ assert a.tolist() == [[slice(0, 1, None), 1], [0, 1]]
+
def test_tolist_slice(self):
from numpy import array
a = array([[17.1, 27.2], [40.3, 50.3]])
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit