[pypy-commit] pypy numpypy.float16: remove untested and unused pack_str

mattip noreply at buildbot.pypy.org
Mon Nov 5 20:08:32 CET 2012


Author: mattip <matti.picus at gmail.com>
Branch: numpypy.float16
Changeset: r58743:585968f4df8a
Date: 2012-11-05 21:08 +0200
http://bitbucket.org/pypy/pypy/changeset/585968f4df8a/

Log:	remove untested and unused pack_str

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
@@ -1,6 +1,5 @@
 import functools
 import math
-import struct
 
 from pypy.interpreter.error import OperationError
 from pypy.module.micronumpy import interp_boxes
@@ -182,9 +181,6 @@
         v = runpack(self.format_code, s)
         return self.box(v)
 
-    def pack_str(self, box):
-        return struct.pack(self.format_code, self.unbox(box))
-
     @simple_binary_op
     def add(self, v1, v2):
         return v1 + v2
@@ -299,9 +295,6 @@
         value = byteswap(value)
         raw_storage_setitem(storage, i + offset, value)
 
-    def pack_str(self, box):
-        return struct.pack(self.format_code, byteswap(self.unbox(box)))
-
 class Bool(BaseType, Primitive):
     _attrs_ = ()
 
@@ -915,10 +908,6 @@
         #value = byteswap(value) XXX
         raw_storage_setitem(storage, i + offset, value)
 
-    def pack_str(self, box):
-        # XXX byteswap
-        return struct.pack(self.format_code, self.unbox(box))
-
 
 class Float16(BaseType, Float):
     _attrs_ = ()
@@ -927,10 +916,6 @@
 
     BoxType = interp_boxes.W_Float16Box
 
-    def pack_str(self, box):
-        hbits = float_pack(self.unbox(box), 2)
-        return struct.pack('H', hbits)
-
     def get_element_size(self):
         return rffi.sizeof(self._STORAGE_T)
 
@@ -969,10 +954,6 @@
         #value = byteswap(value) XXX
         Float16._write(self, storage, i, offset, value)
 
-    def pack_str(self, box):
-        # XXX byteswap
-        return Float16.pack_str(self, box)
-
 class Float32(BaseType, Float):
     _attrs_ = ()
 


More information about the pypy-commit mailing list