Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r67626:6c7dc561b8f5
Date: 2013-10-25 15:49 -0700
http://bitbucket.org/pypy/pypy/changeset/6c7dc561b8f5/

Log:    backout b40380d0b61e (kill __long__) for py3k

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
@@ -146,11 +146,6 @@
         assert isinstance(box, W_LongBox)
         return space.wrap(box.value)
 
-    def descr_long(self, space):
-        box = self.convert_to(W_Int64Box._get_dtype(space))
-        assert isinstance(box, W_Int64Box)
-        return space.wrap(box.value)
-
     def descr_float(self, space):
         box = self.convert_to(W_Float64Box._get_dtype(space))
         assert isinstance(box, W_Float64Box)
@@ -453,7 +448,6 @@
     __repr__ = interp2app(W_GenericBox.descr_str),
     __format__ = interp2app(W_GenericBox.descr_format),
     __int__ = interp2app(W_GenericBox.descr_int),
-    __long__ = interp2app(W_GenericBox.descr_long),
     __float__ = interp2app(W_GenericBox.descr_float),
     __bool__ = interp2app(W_GenericBox.descr_nonzero),
 
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
@@ -895,15 +895,6 @@
             return space.int(self.descr_getitem(space, space.wrap(0)))
         raise OperationError(space.w_TypeError, space.wrap("only length-1 
arrays can be converted to Python scalars"))
 
-    def descr_long(self, space):
-        shape = self.get_shape()
-        if len(shape) == 0:
-            assert isinstance(self.implementation, scalar.Scalar)
-            return 
space.long(space.wrap(self.implementation.get_scalar_value()))
-        if shape == [1]:
-            return space.int(self.descr_getitem(space, space.wrap(0)))
-        raise OperationError(space.w_TypeError, space.wrap("only length-1 
arrays can be converted to Python scalars"))
-
     def descr_float(self, space):
         shape = self.get_shape()
         if len(shape) == 0:
@@ -1030,7 +1021,6 @@
     __repr__ = interp2app(W_NDimArray.descr_repr),
     __str__ = interp2app(W_NDimArray.descr_str),
     __int__ = interp2app(W_NDimArray.descr_int),
-    __long__ = interp2app(W_NDimArray.descr_long),
     __float__ = interp2app(W_NDimArray.descr_float),
 
     __pos__ = interp2app(W_NDimArray.descr_pos),
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
@@ -1914,15 +1914,6 @@
         b = array([1, 2, 3, 4])
         assert (a == b) == False
 
-    def test__long__(self):
-        from numpypy import array
-        assert long(array(1)) == 1
-        assert long(array([1])) == 1
-        assert isinstance(long(array([1])), long)
-        assert isinstance(long(array([1, 2][0])), long)
-        assert raises(TypeError, "long(array([1, 2]))")
-        assert long(array([1.5])) == 1
-
     def test__int__(self):
         from numpypy import array
         assert int(array(1)) == 1
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to