Commits

Brian Kearns  committed be547e3

cleanup

  • Participants
  • Parent commits 6c99fe0

Comments (0)

Files changed (2)

File pypy/module/micronumpy/base.py

         elif owning:
             # Will free storage when GCd
             impl = concrete.ConcreteArray(shape, dtype, order, strides,
-                                                backstrides, storage=storage)
+                                          backstrides, storage=storage)
         else:
             impl = concrete.ConcreteArrayNotOwning(shape, dtype, order, strides,
-                                                backstrides, storage)
+                                                   backstrides, storage)
         if w_subtype:
             w_ret = space.allocate_instance(W_NDimArray, w_subtype)
             W_NDimArray.__init__(w_ret, impl)

File pypy/module/micronumpy/boxes.py

         value[0] = self.value
 
         builder = StringBuilder()
-        builder.append_charpsize(rffi.cast(rffi.CCHARP, value), rffi.sizeof(lltype.typeOf(self.value)))
+        builder.append_charpsize(rffi.cast(rffi.CCHARP, value),
+                                 rffi.sizeof(lltype.typeOf(self.value)))
         ret = builder.build()
 
         lltype.free(value, flavor="raw")
         value[1] = self.imag
 
         builder = StringBuilder()
-        builder.append_charpsize(rffi.cast(rffi.CCHARP, value), rffi.sizeof(lltype.typeOf(self.real)) * 2)
+        builder.append_charpsize(rffi.cast(rffi.CCHARP, value),
+                                 rffi.sizeof(lltype.typeOf(self.real)) * 2)
         ret = builder.build()
 
         lltype.free(value, flavor="raw")
         dtype = self.get_dtype(space)
         return space.wrap(dtype.itemtype.bool(self))
 
+    def _unaryop_impl(ufunc_name):
+        def impl(self, space, w_out=None):
+            from pypy.module.micronumpy import ufuncs
+            return getattr(ufuncs.get(space), ufunc_name).call(
+                space, [self, w_out])
+        return func_with_new_name(impl, "unaryop_%s_impl" % ufunc_name)
+
     def _binop_impl(ufunc_name):
         def impl(self, space, w_other, w_out=None):
             from pypy.module.micronumpy import ufuncs
-            return getattr(ufuncs.get(space), ufunc_name).call(space,
-                                                            [self, w_other, w_out])
+            return getattr(ufuncs.get(space), ufunc_name).call(
+                space, [self, w_other, w_out])
         return func_with_new_name(impl, "binop_%s_impl" % ufunc_name)
 
     def _binop_right_impl(ufunc_name):
         def impl(self, space, w_other, w_out=None):
             from pypy.module.micronumpy import ufuncs
-            return getattr(ufuncs.get(space), ufunc_name).call(space,
-                                                            [w_other, self, w_out])
+            return getattr(ufuncs.get(space), ufunc_name).call(
+                space, [w_other, self, w_out])
         return func_with_new_name(impl, "binop_right_%s_impl" % ufunc_name)
 
-    def _unaryop_impl(ufunc_name):
-        def impl(self, space, w_out=None):
-            from pypy.module.micronumpy import ufuncs
-            return getattr(ufuncs.get(space), ufunc_name).call(space,
-                                                                    [self, w_out])
-        return func_with_new_name(impl, "unaryop_%s_impl" % ufunc_name)
-
     descr_add = _binop_impl("add")
     descr_sub = _binop_impl("subtract")
     descr_mul = _binop_impl("multiply")