Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r71299:d8096ef0c138
Date: 2014-05-05 18:38 -0700
http://bitbucket.org/pypy/pypy/changeset/d8096ef0c138/
Log: merge default
diff --git a/pypy/doc/release-2.3.0.rst b/pypy/doc/release-2.3.0.rst
--- a/pypy/doc/release-2.3.0.rst
+++ b/pypy/doc/release-2.3.0.rst
@@ -84,7 +84,7 @@
* Fix issues with reimporting builtin modules
-* Fix a RPython bug with loop-unrolling that appeared in the `HippyVM`_ PHP
port
+* Fix an RPython bug with loop-unrolling that appeared in the `HippyVM`_ PHP
port
* Support for corner cases on objects with __int__ and __float__ methods
@@ -125,7 +125,7 @@
and scalars were corrected. We are slowly approaching our goal of passing
the NumPy test suite. We still do not support object or unicode ndarrays.
-* speed of iteration in dot() is now within 1.5x of the NumPy c
+* Speed of iteration in dot() is now within 1.5x of the NumPy c
implementation (without BLAS acceleration). Since the same array
iterator is used throughout the ``_numpy`` module, speed increases should
be apparent in all NumPy functionality.
@@ -135,7 +135,7 @@
* A cffi-based ``numpy.random`` module is available as a branch;
it will be merged soon after this release.
-* enhancements to the PyPy JIT were made to support virtualizing the
raw_store/raw_load
+* Enhancements to the PyPy JIT were made to support virtualizing the
raw_store/raw_load
memory operations used in NumPy arrays. Further work remains here in
virtualizing the
alloc_raw_storage when possible. This will allow scalars to have storages
but still be
virtualized when possible in loops.
diff --git a/pypy/module/_io/interp_bytesio.py
b/pypy/module/_io/interp_bytesio.py
--- a/pypy/module/_io/interp_bytesio.py
+++ b/pypy/module/_io/interp_bytesio.py
@@ -199,8 +199,7 @@
space.call_method(self.getdict(space), "update", w_dict)
W_BytesIO.typedef = TypeDef(
- 'BytesIO', W_BufferedIOBase.typedef,
- __module__ = "_io",
+ '_io.BytesIO', W_BufferedIOBase.typedef,
__new__ = interp2app(W_BytesIO.descr_new.im_func),
__init__ = interp2app(W_BytesIO.descr_init),
diff --git a/pypy/module/_io/interp_fileio.py b/pypy/module/_io/interp_fileio.py
--- a/pypy/module/_io/interp_fileio.py
+++ b/pypy/module/_io/interp_fileio.py
@@ -436,8 +436,7 @@
return w_size
W_FileIO.typedef = TypeDef(
- 'FileIO', W_RawIOBase.typedef,
- __module__ = "_io",
+ '_io.FileIO', W_RawIOBase.typedef,
__new__ = interp2app(W_FileIO.descr_new.im_func),
__init__ = interp2app(W_FileIO.descr_init),
__repr__ = interp2app(W_FileIO.repr_w),
diff --git a/pypy/module/_io/interp_io.py b/pypy/module/_io/interp_io.py
--- a/pypy/module/_io/interp_io.py
+++ b/pypy/module/_io/interp_io.py
@@ -27,10 +27,9 @@
self.written = written
W_BlockingIOError.typedef = TypeDef(
- 'BlockingIOError', W_IOError.typedef,
- __module__ = 'io',
- __doc__ = ("Exception raised when I/O would block "
- "on a non-blocking I/O stream"),
+ '_io.BlockingIOError', W_IOError.typedef,
+ __doc__ = ("Exception raised when I/O would block on a non-blocking "
+ "I/O stream"),
__new__ = generic_new_descr(W_BlockingIOError),
__init__ = interp2app(W_BlockingIOError.descr_init),
characters_written = interp_attrproperty('written', W_BlockingIOError),
diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py
--- a/pypy/module/_io/interp_iobase.py
+++ b/pypy/module/_io/interp_iobase.py
@@ -299,8 +299,7 @@
break
W_IOBase.typedef = TypeDef(
- '_IOBase',
- __module__ = "_io",
+ '_io._IOBase',
__new__ = generic_new_descr(W_IOBase),
__enter__ = interp2app(W_IOBase.enter_w),
__exit__ = interp2app(W_IOBase.exit_w),
@@ -372,8 +371,7 @@
return space.wrapbytes(builder.build())
W_RawIOBase.typedef = TypeDef(
- '_RawIOBase', W_IOBase.typedef,
- __module__ = "_io",
+ '_io._RawIOBase', W_IOBase.typedef,
__new__ = generic_new_descr(W_RawIOBase),
read = interp2app(W_RawIOBase.read_w),
diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -178,8 +178,7 @@
space.call_method(self.w_decoder, "setstate", w_state)
W_IncrementalNewlineDecoder.typedef = TypeDef(
- 'IncrementalNewlineDecoder',
- __module__ = "_io",
+ '_io.IncrementalNewlineDecoder',
__new__ = generic_new_descr(W_IncrementalNewlineDecoder),
__init__ = interp2app(W_IncrementalNewlineDecoder.descr_init),
@@ -256,8 +255,7 @@
W_TextIOBase.typedef = TypeDef(
- '_TextIOBase', W_IOBase.typedef,
- __module__ = "_io",
+ '_io._TextIOBase', W_IOBase.typedef,
__new__ = generic_new_descr(W_TextIOBase),
read = interp2app(W_TextIOBase.read_w),
diff --git a/pypy/module/_io/test/test_io.py b/pypy/module/_io/test/test_io.py
--- a/pypy/module/_io/test/test_io.py
+++ b/pypy/module/_io/test/test_io.py
@@ -381,5 +381,6 @@
def test_mod(self):
import _io
- assert all(t.__module__ in ('io', '_io') for t in vars(_io).values()
- if isinstance(t, type))
+ typemods = dict((t, t.__module__) for t in vars(_io).values()
+ if isinstance(t, type))
+ assert all(mod in ('io', '_io') for mod in typemods.values()), typemods
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
@@ -729,6 +729,8 @@
ret = W_NDimArray.from_shape(
space, v.get_shape(),
descriptor.get_dtype_cache(space).w_longdtype)
app_searchsort(space, self, v, space.wrap(side), ret)
+ if ret.is_scalar():
+ return ret.get_scalar_value()
return ret
def descr_setasflat(self, space, w_v):
diff --git a/pypy/module/micronumpy/test/test_sorting.py
b/pypy/module/micronumpy/test/test_sorting.py
--- a/pypy/module/micronumpy/test/test_sorting.py
+++ b/pypy/module/micronumpy/test/test_sorting.py
@@ -351,13 +351,21 @@
assert (x.argsort(kind='m') == np.arange(32)).all()
def test_searchsort(self):
- from numpy import arange
+ import numpy as np
import sys
- a = arange(1, 6)
+ a = np.arange(1, 6)
ret = a.searchsorted(3)
assert ret == 2
+ assert isinstance(ret, np.generic)
+ ret = a.searchsorted(np.array(3))
+ assert ret == 2
+ assert isinstance(ret, np.generic)
+ ret = a.searchsorted(np.array([3]))
+ assert ret == 2
+ assert isinstance(ret, np.ndarray)
ret = a.searchsorted(3, side='right')
assert ret == 3
+ assert isinstance(ret, np.generic)
ret = a.searchsorted([-10, 10, 2, 3])
assert (ret == [0, 5, 1, 2]).all()
if '__pypy__' in sys.builtin_module_names:
diff --git a/rpython/translator/platform/__init__.py
b/rpython/translator/platform/__init__.py
--- a/rpython/translator/platform/__init__.py
+++ b/rpython/translator/platform/__init__.py
@@ -267,7 +267,7 @@
# Only required on armhf and mips{,el}, not armel. But there's no way to
# detect armhf without shelling out
if (platform.architecture()[0] == '64bit'
- or platform.machine().startswith(('arm', 'mips'))):
+ or platform.machine().startswith(('arm', 'mips', 'ppc'))):
host_factory = LinuxPIC
else:
host_factory = Linux
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit