Author: Maciej Fijalkowski <[email protected]>
Branch: backend-vector-ops
Changeset: r52397:e6b7060ae276
Date: 2012-02-11 19:01 +0200
http://bitbucket.org/pypy/pypy/changeset/e6b7060ae276/
Log: merge default
diff --git a/lib_pypy/datetime.py b/lib_pypy/datetime.py
--- a/lib_pypy/datetime.py
+++ b/lib_pypy/datetime.py
@@ -1520,7 +1520,7 @@
def utcfromtimestamp(cls, t):
"Construct a UTC datetime from a POSIX timestamp (like time.time())."
t, frac = divmod(t, 1.0)
- us = round(frac * 1e6)
+ us = int(round(frac * 1e6))
# If timestamp is less than one microsecond smaller than a
# full second, us can be rounded up to 1000000. In this case,
diff --git a/pypy/doc/getting-started-python.rst
b/pypy/doc/getting-started-python.rst
--- a/pypy/doc/getting-started-python.rst
+++ b/pypy/doc/getting-started-python.rst
@@ -103,18 +103,22 @@
executable. The executable behaves mostly like a normal Python interpreter::
$ ./pypy-c
- Python 2.7.0 (61ef2a11b56a, Mar 02 2011, 03:00:11)
- [PyPy 1.6.0 with GCC 4.4.3] on linux2
+ Python 2.7.2 (0e28b379d8b3, Feb 09 2012, 19:41:03)
+ [PyPy 1.8.0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``this sentence is false''
>>>> 46 - 4
42
>>>> from test import pystone
>>>> pystone.main()
- Pystone(1.1) time for 50000 passes = 0.280017
- This machine benchmarks at 178561 pystones/second
- >>>>
+ Pystone(1.1) time for 50000 passes = 0.220015
+ This machine benchmarks at 227257 pystones/second
+ >>>> pystone.main()
+ Pystone(1.1) time for 50000 passes = 0.060004
+ This machine benchmarks at 833278 pystones/second
+ >>>>
+Note that pystone gets faster as the JIT kicks in.
This executable can be moved around or copied on other machines; see
Installation_ below.
diff --git a/pypy/doc/getting-started.rst b/pypy/doc/getting-started.rst
--- a/pypy/doc/getting-started.rst
+++ b/pypy/doc/getting-started.rst
@@ -53,14 +53,15 @@
PyPy is ready to be executed as soon as you unpack the tarball or the zip
file, with no need to install it in any specific location::
- $ tar xf pypy-1.7-linux.tar.bz2
-
- $ ./pypy-1.7/bin/pypy
- Python 2.7.1 (?, Apr 27 2011, 12:44:21)
- [PyPy 1.7.0 with GCC 4.4.3] on linux2
+ $ tar xf pypy-1.8-linux.tar.bz2
+ $ ./pypy-1.8/bin/pypy
+ Python 2.7.2 (0e28b379d8b3, Feb 09 2012, 19:41:03)
+ [PyPy 1.8.0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
- And now for something completely different: ``implementing LOGO in LOGO:
- "turtles all the way down"''
+ And now for something completely different: ``it seems to me that once you
+ settle on an execution / object model and / or bytecode format, you've
already
+ decided what languages (where the 's' seems superfluous) support is going
to be
+ first class for''
>>>>
If you want to make PyPy available system-wide, you can put a symlink to the
@@ -75,14 +76,14 @@
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
- $ ./pypy-1.7/bin/pypy distribute_setup.py
+ $ ./pypy-1.8/bin/pypy distribute_setup.py
- $ ./pypy-1.7/bin/pypy get-pip.py
+ $ ./pypy-1.8/bin/pypy get-pip.py
- $ ./pypy-1.7/bin/pip install pygments # for example
+ $ ./pypy-1.8/bin/pip install pygments # for example
-3rd party libraries will be installed in ``pypy-1.7/site-packages``, and
-the scripts in ``pypy-1.7/bin``.
+3rd party libraries will be installed in ``pypy-1.8/site-packages``, and
+the scripts in ``pypy-1.8/bin``.
Installing using virtualenv
---------------------------
diff --git a/pypy/doc/index.rst b/pypy/doc/index.rst
--- a/pypy/doc/index.rst
+++ b/pypy/doc/index.rst
@@ -15,7 +15,7 @@
* `FAQ`_: some frequently asked questions.
-* `Release 1.7`_: the latest official release
+* `Release 1.8`_: the latest official release
* `PyPy Blog`_: news and status info about PyPy
@@ -75,7 +75,7 @@
.. _`Getting Started`: getting-started.html
.. _`Papers`: extradoc.html
.. _`Videos`: video-index.html
-.. _`Release 1.7`: http://pypy.org/download.html
+.. _`Release 1.8`: http://pypy.org/download.html
.. _`speed.pypy.org`: http://speed.pypy.org
.. _`RPython toolchain`: translation.html
.. _`potential project ideas`: project-ideas.html
@@ -120,9 +120,9 @@
Windows, on top of .NET, and on top of Java.
To dig into PyPy it is recommended to try out the current
Mercurial default branch, which is always working or mostly working,
-instead of the latest release, which is `1.7`__.
+instead of the latest release, which is `1.8`__.
-.. __: release-1.7.0.html
+.. __: release-1.8.0.html
PyPy is mainly developed on Linux and Mac OS X. Windows is supported,
but platform-specific bugs tend to take longer before we notice and fix
diff --git a/pypy/doc/release-1.8.0.rst b/pypy/doc/release-1.8.0.rst
--- a/pypy/doc/release-1.8.0.rst
+++ b/pypy/doc/release-1.8.0.rst
@@ -2,16 +2,21 @@
PyPy 1.8 - business as usual
============================
-We're pleased to announce the 1.8 release of PyPy. As has become a habit, this
-release brings a lot of bugfixes, and performance and memory improvements over
-the 1.7 release. The main highlight of the release is the introduction of
-list strategies which makes homogenous lists more efficient both in terms
-of performance and memory. This release also upgrades us from Python 2.7.1
compatibility to 2.7.2. Otherwise it's "business as usual" in the sense
-that performance improved roughly 10% on average since the previous release.
-You can download the PyPy 1.8 release here:
+We're pleased to announce the 1.8 release of PyPy. As habitual this
+release brings a lot of bugfixes, together with performance and memory
+improvements over the 1.7 release. The main highlight of the release
+is the introduction of `list strategies`_ which makes homogenous lists
+more efficient both in terms of performance and memory. This release
+also upgrades us from Python 2.7.1 compatibility to 2.7.2. Otherwise
+it's "business as usual" in the sense that performance improved
+roughly 10% on average since the previous release.
+
+you can download the PyPy 1.8 release here:
http://pypy.org/download.html
+.. _`list strategies`:
http://morepypy.blogspot.com/2011/10/more-compact-lists-with-list-strategies.html
+
What is PyPy?
=============
@@ -60,13 +65,6 @@
* New JIT hooks that allow you to hook into the JIT process from your python
program. There is a `brief overview`_ of what they offer.
-* Since the last release there was a significant breakthrough in PyPy's
- fundraising. We now have enough funds to work on first stages of `numpypy`_
- and `py3k`_. We would like to thank again to everyone who donated.
-
- It's also probably worth noting, we're considering donations for the STM
- project.
-
* Standard library upgrade from 2.7.1 to 2.7.2.
Ongoing work
@@ -82,7 +80,15 @@
* More numpy work
-* Software Transactional Memory, you can read more about `our plans`_
+* Since the last release there was a significant breakthrough in PyPy's
+ fundraising. We now have enough funds to work on first stages of `numpypy`_
+ and `py3k`_. We would like to thank again to everyone who donated.
+
+* It's also probably worth noting, we're considering donations for the
+ Software Transactional Memory project. You can read more about `our plans`_
+
+Cheers,
+The PyPy Team
.. _`brief overview`: http://doc.pypy.org/en/latest/jit-hooks.html
.. _`numpy status page`: http://buildbot.pypy.org/numpy-status/latest.html
diff --git a/pypy/module/_io/test/test_fileio.py
b/pypy/module/_io/test/test_fileio.py
--- a/pypy/module/_io/test/test_fileio.py
+++ b/pypy/module/_io/test/test_fileio.py
@@ -134,7 +134,10 @@
assert a == 'a\nbxxxxxxx'
def test_nonblocking_read(self):
- import os, fcntl
+ try:
+ import os, fcntl
+ except ImportError:
+ skip("need fcntl to set nonblocking mode")
r_fd, w_fd = os.pipe()
# set nonblocking
fcntl.fcntl(r_fd, fcntl.F_SETFL, os.O_NONBLOCK)
diff --git a/pypy/module/cpyext/include/patchlevel.h
b/pypy/module/cpyext/include/patchlevel.h
--- a/pypy/module/cpyext/include/patchlevel.h
+++ b/pypy/module/cpyext/include/patchlevel.h
@@ -21,12 +21,12 @@
/* Version parsed out into numeric values */
#define PY_MAJOR_VERSION 2
#define PY_MINOR_VERSION 7
-#define PY_MICRO_VERSION 1
+#define PY_MICRO_VERSION 2
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "2.7.1"
+#define PY_VERSION "2.7.2"
/* PyPy version as a string */
#define PYPY_VERSION "1.8.1"
diff --git a/pypy/module/micronumpy/__init__.py
b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -95,6 +95,7 @@
("tan", "tan"),
('bitwise_and', 'bitwise_and'),
('bitwise_or', 'bitwise_or'),
+ ('bitwise_xor', 'bitwise_xor'),
('bitwise_not', 'invert'),
('isnan', 'isnan'),
('isinf', 'isinf'),
diff --git a/pypy/module/micronumpy/interp_boxes.py
b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -83,6 +83,8 @@
descr_truediv = _binop_impl("true_divide")
descr_mod = _binop_impl("mod")
descr_pow = _binop_impl("power")
+ descr_lshift = _binop_impl("left_shift")
+ descr_rshift = _binop_impl("right_shift")
descr_and = _binop_impl("bitwise_and")
descr_or = _binop_impl("bitwise_or")
descr_xor = _binop_impl("bitwise_xor")
@@ -97,13 +99,31 @@
descr_radd = _binop_right_impl("add")
descr_rsub = _binop_right_impl("subtract")
descr_rmul = _binop_right_impl("multiply")
+ descr_rdiv = _binop_right_impl("divide")
+ descr_rtruediv = _binop_right_impl("true_divide")
+ descr_rmod = _binop_right_impl("mod")
descr_rpow = _binop_right_impl("power")
+ descr_rlshift = _binop_right_impl("left_shift")
+ descr_rrshift = _binop_right_impl("right_shift")
+ descr_rand = _binop_right_impl("bitwise_and")
+ descr_ror = _binop_right_impl("bitwise_or")
+ descr_rxor = _binop_right_impl("bitwise_xor")
descr_pos = _unaryop_impl("positive")
descr_neg = _unaryop_impl("negative")
descr_abs = _unaryop_impl("absolute")
descr_invert = _unaryop_impl("invert")
+ def descr_divmod(self, space, w_other):
+ w_quotient = self.descr_div(space, w_other)
+ w_remainder = self.descr_mod(space, w_other)
+ return space.newtuple([w_quotient, w_remainder])
+
+ def descr_rdivmod(self, space, w_other):
+ w_quotient = self.descr_rdiv(space, w_other)
+ w_remainder = self.descr_rmod(space, w_other)
+ return space.newtuple([w_quotient, w_remainder])
+
def item(self, space):
return self.get_dtype(space).itemtype.to_builtin_type(space, self)
@@ -185,7 +205,10 @@
__div__ = interp2app(W_GenericBox.descr_div),
__truediv__ = interp2app(W_GenericBox.descr_truediv),
__mod__ = interp2app(W_GenericBox.descr_mod),
+ __divmod__ = interp2app(W_GenericBox.descr_divmod),
__pow__ = interp2app(W_GenericBox.descr_pow),
+ __lshift__ = interp2app(W_GenericBox.descr_lshift),
+ __rshift__ = interp2app(W_GenericBox.descr_rshift),
__and__ = interp2app(W_GenericBox.descr_and),
__or__ = interp2app(W_GenericBox.descr_or),
__xor__ = interp2app(W_GenericBox.descr_xor),
@@ -193,7 +216,16 @@
__radd__ = interp2app(W_GenericBox.descr_radd),
__rsub__ = interp2app(W_GenericBox.descr_rsub),
__rmul__ = interp2app(W_GenericBox.descr_rmul),
+ __rdiv__ = interp2app(W_GenericBox.descr_rdiv),
+ __rtruediv__ = interp2app(W_GenericBox.descr_rtruediv),
+ __rmod__ = interp2app(W_GenericBox.descr_rmod),
+ __rdivmod__ = interp2app(W_GenericBox.descr_rdivmod),
__rpow__ = interp2app(W_GenericBox.descr_rpow),
+ __rlshift__ = interp2app(W_GenericBox.descr_rlshift),
+ __rrshift__ = interp2app(W_GenericBox.descr_rrshift),
+ __rand__ = interp2app(W_GenericBox.descr_rand),
+ __ror__ = interp2app(W_GenericBox.descr_ror),
+ __rxor__ = interp2app(W_GenericBox.descr_rxor),
__eq__ = interp2app(W_GenericBox.descr_eq),
__ne__ = interp2app(W_GenericBox.descr_ne),
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -101,8 +101,14 @@
descr_sub = _binop_impl("subtract")
descr_mul = _binop_impl("multiply")
descr_div = _binop_impl("divide")
+ descr_truediv = _binop_impl("true_divide")
+ descr_mod = _binop_impl("mod")
descr_pow = _binop_impl("power")
- descr_mod = _binop_impl("mod")
+ descr_lshift = _binop_impl("left_shift")
+ descr_rshift = _binop_impl("right_shift")
+ descr_and = _binop_impl("bitwise_and")
+ descr_or = _binop_impl("bitwise_or")
+ descr_xor = _binop_impl("bitwise_xor")
descr_eq = _binop_impl("equal")
descr_ne = _binop_impl("not_equal")
@@ -111,8 +117,10 @@
descr_gt = _binop_impl("greater")
descr_ge = _binop_impl("greater_equal")
- descr_and = _binop_impl("bitwise_and")
- descr_or = _binop_impl("bitwise_or")
+ def descr_divmod(self, space, w_other):
+ w_quotient = self.descr_div(space, w_other)
+ w_remainder = self.descr_mod(space, w_other)
+ return space.newtuple([w_quotient, w_remainder])
def _binop_right_impl(ufunc_name):
def impl(self, space, w_other):
@@ -127,8 +135,19 @@
descr_rsub = _binop_right_impl("subtract")
descr_rmul = _binop_right_impl("multiply")
descr_rdiv = _binop_right_impl("divide")
+ descr_rtruediv = _binop_right_impl("true_divide")
+ descr_rmod = _binop_right_impl("mod")
descr_rpow = _binop_right_impl("power")
- descr_rmod = _binop_right_impl("mod")
+ descr_rlshift = _binop_right_impl("left_shift")
+ descr_rrshift = _binop_right_impl("right_shift")
+ descr_rand = _binop_right_impl("bitwise_and")
+ descr_ror = _binop_right_impl("bitwise_or")
+ descr_rxor = _binop_right_impl("bitwise_xor")
+
+ def descr_rdivmod(self, space, w_other):
+ w_quotient = self.descr_rdiv(space, w_other)
+ w_remainder = self.descr_rmod(space, w_other)
+ return space.newtuple([w_quotient, w_remainder])
def _reduce_ufunc_impl(ufunc_name, promote_to_largest=False):
def impl(self, space, w_axis=None):
@@ -1227,21 +1246,36 @@
__pos__ = interp2app(BaseArray.descr_pos),
__neg__ = interp2app(BaseArray.descr_neg),
__abs__ = interp2app(BaseArray.descr_abs),
+ __invert__ = interp2app(BaseArray.descr_invert),
__nonzero__ = interp2app(BaseArray.descr_nonzero),
__add__ = interp2app(BaseArray.descr_add),
__sub__ = interp2app(BaseArray.descr_sub),
__mul__ = interp2app(BaseArray.descr_mul),
__div__ = interp2app(BaseArray.descr_div),
+ __truediv__ = interp2app(BaseArray.descr_truediv),
+ __mod__ = interp2app(BaseArray.descr_mod),
+ __divmod__ = interp2app(BaseArray.descr_divmod),
__pow__ = interp2app(BaseArray.descr_pow),
- __mod__ = interp2app(BaseArray.descr_mod),
+ __lshift__ = interp2app(BaseArray.descr_lshift),
+ __rshift__ = interp2app(BaseArray.descr_rshift),
+ __and__ = interp2app(BaseArray.descr_and),
+ __or__ = interp2app(BaseArray.descr_or),
+ __xor__ = interp2app(BaseArray.descr_xor),
__radd__ = interp2app(BaseArray.descr_radd),
__rsub__ = interp2app(BaseArray.descr_rsub),
__rmul__ = interp2app(BaseArray.descr_rmul),
__rdiv__ = interp2app(BaseArray.descr_rdiv),
+ __rtruediv__ = interp2app(BaseArray.descr_rtruediv),
+ __rmod__ = interp2app(BaseArray.descr_rmod),
+ __rdivmod__ = interp2app(BaseArray.descr_rdivmod),
__rpow__ = interp2app(BaseArray.descr_rpow),
- __rmod__ = interp2app(BaseArray.descr_rmod),
+ __rlshift__ = interp2app(BaseArray.descr_rlshift),
+ __rrshift__ = interp2app(BaseArray.descr_rrshift),
+ __rand__ = interp2app(BaseArray.descr_rand),
+ __ror__ = interp2app(BaseArray.descr_ror),
+ __rxor__ = interp2app(BaseArray.descr_rxor),
__eq__ = interp2app(BaseArray.descr_eq),
__ne__ = interp2app(BaseArray.descr_ne),
@@ -1250,10 +1284,6 @@
__gt__ = interp2app(BaseArray.descr_gt),
__ge__ = interp2app(BaseArray.descr_ge),
- __and__ = interp2app(BaseArray.descr_and),
- __or__ = interp2app(BaseArray.descr_or),
- __invert__ = interp2app(BaseArray.descr_invert),
-
__repr__ = interp2app(BaseArray.descr_repr),
__str__ = interp2app(BaseArray.descr_str),
__array_interface__ = GetSetProperty(BaseArray.descr_array_iface),
diff --git a/pypy/module/micronumpy/interp_ufuncs.py
b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -392,6 +392,8 @@
("true_divide", "div", 2, {"promote_to_float": True}),
("mod", "mod", 2, {"promote_bools": True}),
("power", "pow", 2, {"promote_bools": True}),
+ ("left_shift", "lshift", 2, {"int_only": True}),
+ ("right_shift", "rshift", 2, {"int_only": True}),
("equal", "eq", 2, {"comparison_func": True}),
("not_equal", "ne", 2, {"comparison_func": True}),
diff --git a/pypy/module/micronumpy/test/test_dtypes.py
b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -406,15 +406,28 @@
from operator import truediv
from _numpypy import float64, int_, True_, False_
+ assert 5 / int_(2) == int_(2)
assert truediv(int_(3), int_(2)) == float64(1.5)
+ assert truediv(3, int_(2)) == float64(1.5)
+ assert int_(8) % int_(3) == int_(2)
+ assert 8 % int_(3) == int_(2)
+ assert divmod(int_(8), int_(3)) == (int_(2), int_(2))
+ assert divmod(8, int_(3)) == (int_(2), int_(2))
assert 2 ** int_(3) == int_(8)
+ assert int_(3) << int_(2) == int_(12)
+ assert 3 << int_(2) == int_(12)
+ assert int_(8) >> int_(2) == int_(2)
+ assert 8 >> int_(2) == int_(2)
assert int_(3) & int_(1) == int_(1)
- raises(TypeError, lambda: float64(3) & 1)
- assert int_(8) % int_(3) == int_(2)
+ assert 2 & int_(3) == int_(2)
assert int_(2) | int_(1) == int_(3)
+ assert 2 | int_(1) == int_(3)
assert int_(3) ^ int_(5) == int_(6)
assert True_ ^ False_ is True_
+ assert 5 ^ int_(3) == int_(6)
assert +int_(3) == int_(3)
assert ~int_(3) == int_(-4)
+ raises(TypeError, lambda: float64(3) & 1)
+
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -625,6 +625,59 @@
for i in range(5):
assert b[i] == i / 5.0
+ def test_truediv(self):
+ from operator import truediv
+ from _numpypy import arange
+
+ assert (truediv(arange(5), 2) == [0., .5, 1., 1.5, 2.]).all()
+ assert (truediv(2, arange(3)) == [float("inf"), 2., 1.]).all()
+
+ def test_divmod(self):
+ from _numpypy import arange
+
+ a, b = divmod(arange(10), 3)
+ assert (a == [0, 0, 0, 1, 1, 1, 2, 2, 2, 3]).all()
+ assert (b == [0, 1, 2, 0, 1, 2, 0, 1, 2, 0]).all()
+
+ def test_rdivmod(self):
+ from _numpypy import arange
+
+ a, b = divmod(3, arange(1, 5))
+ assert (a == [3, 1, 1, 0]).all()
+ assert (b == [0, 1, 0, 3]).all()
+
+ def test_lshift(self):
+ from _numpypy import array
+
+ a = array([0, 1, 2, 3])
+ assert (a << 2 == [0, 4, 8, 12]).all()
+ a = array([True, False])
+ assert (a << 2 == [4, 0]).all()
+ a = array([1.0])
+ raises(TypeError, lambda: a << 2)
+
+ def test_rlshift(self):
+ from _numpypy import arange
+
+ a = arange(3)
+ assert (2 << a == [2, 4, 8]).all()
+
+ def test_rshift(self):
+ from _numpypy import arange, array
+
+ a = arange(10)
+ assert (a >> 2 == [0, 0, 0, 0, 1, 1, 1, 1, 2, 2]).all()
+ a = array([True, False])
+ assert (a >> 1 == [0, 0]).all()
+ a = arange(3, dtype=float)
+ raises(TypeError, lambda: a >> 1)
+
+ def test_rrshift(self):
+ from _numpypy import arange
+
+ a = arange(5)
+ assert (2 >> a == [2, 1, 0, 0, 0]).all()
+
def test_pow(self):
from _numpypy import array
a = array(range(5), float)
@@ -678,6 +731,30 @@
for i in range(5):
assert b[i] == i % 2
+ def test_rand(self):
+ from _numpypy import arange
+
+ a = arange(5)
+ assert (3 & a == [0, 1, 2, 3, 0]).all()
+
+ def test_ror(self):
+ from _numpypy import arange
+
+ a = arange(5)
+ assert (3 | a == [3, 3, 3, 3, 7]).all()
+
+ def test_xor(self):
+ from _numpypy import arange
+
+ a = arange(5)
+ assert (a ^ 3 == [3, 2, 1, 0, 7]).all()
+
+ def test_rxor(self):
+ from _numpypy import arange
+
+ a = arange(5)
+ assert (3 ^ a == [3, 2, 1, 0, 7]).all()
+
def test_pos(self):
from _numpypy import array
a = array([1., -2., 3., -4., -5.])
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py
b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -368,14 +368,14 @@
assert b.shape == (1, 4)
assert (add.reduce(a, 0, keepdims=True) == [12, 15, 18, 21]).all()
-
def test_bitwise(self):
- from _numpypy import bitwise_and, bitwise_or, arange, array
+ from _numpypy import bitwise_and, bitwise_or, bitwise_xor, arange,
array
a = arange(6).reshape(2, 3)
assert (a & 1 == [[0, 1, 0], [1, 0, 1]]).all()
assert (a & 1 == bitwise_and(a, 1)).all()
assert (a | 1 == [[1, 1, 3], [3, 5, 5]]).all()
assert (a | 1 == bitwise_or(a, 1)).all()
+ assert (a ^ 3 == bitwise_xor(a, 3)).all()
raises(TypeError, 'array([1.0]) & 1')
def test_unary_bitops(self):
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -295,6 +295,14 @@
v1 *= v1
return res
+ @simple_binary_op
+ def lshift(self, v1, v2):
+ return v1 << v2
+
+ @simple_binary_op
+ def rshift(self, v1, v2):
+ return v1 >> v2
+
@simple_unary_op
def sign(self, v):
if v > 0:
diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py
--- a/pypy/module/sys/version.py
+++ b/pypy/module/sys/version.py
@@ -7,7 +7,7 @@
from pypy.interpreter import gateway
#XXX # the release serial 42 is not in range(16)
-CPYTHON_VERSION = (2, 7, 1, "final", 42) #XXX # sync patchlevel.h
+CPYTHON_VERSION = (2, 7, 2, "final", 42) #XXX # sync patchlevel.h
CPYTHON_API_VERSION = 1013 #XXX # sync with include/modsupport.h
PYPY_VERSION = (1, 8, 1, "dev", 0) #XXX # sync patchlevel.h
diff --git a/pypy/module/test_lib_pypy/test_datetime.py
b/pypy/module/test_lib_pypy/test_datetime.py
--- a/pypy/module/test_lib_pypy/test_datetime.py
+++ b/pypy/module/test_lib_pypy/test_datetime.py
@@ -22,3 +22,7 @@
del os.environ["TZ"]
else:
os.environ["TZ"] = prev_tz
+
+def test_utcfromtimestamp_microsecond():
+ dt = datetime.datetime.utcfromtimestamp(0)
+ assert isinstance(dt.microsecond, int)
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -60,7 +60,8 @@
if sys.platform == 'win32':
# Can't rename a DLL: it is always called 'libpypy-c.dll'
for extra in ['libpypy-c.dll',
- 'libexpat.dll', 'sqlite3.dll', 'msvcr90.dll']:
+ 'libexpat.dll', 'sqlite3.dll', 'msvcr90.dll',
+ 'libeay32.dll', 'ssleay32.dll']:
p = pypy_c.dirpath().join(extra)
if not p.check():
p = py.path.local.sysfind(extra)
diff --git a/pypy/translator/c/gcc/trackgcroot.py
b/pypy/translator/c/gcc/trackgcroot.py
--- a/pypy/translator/c/gcc/trackgcroot.py
+++ b/pypy/translator/c/gcc/trackgcroot.py
@@ -478,6 +478,7 @@
'cvt', 'ucomi', 'comi', 'subs', 'subp' , 'adds', 'addp', 'xorp',
'movap', 'movd', 'movlp', 'sqrtsd', 'movhpd',
'mins', 'minp', 'maxs', 'maxp', 'unpck', 'pxor', 'por', # sse2
+ 'shufps', 'shufpd',
# arithmetic operations should not produce GC pointers
'inc', 'dec', 'not', 'neg', 'or', 'and', 'sbb', 'adc',
'shl', 'shr', 'sal', 'sar', 'rol', 'ror', 'mul', 'imul', 'div', 'idiv',
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit