[pypy-commit] pypy numpy-refactor: some fixes for sum

fijal noreply at buildbot.pypy.org
Wed Sep 5 13:31:32 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-refactor
Changeset: r57145:b0eaf9f42b7e
Date: 2012-09-05 13:09 +0200
http://bitbucket.org/pypy/pypy/changeset/b0eaf9f42b7e/

Log:	some fixes for sum

diff --git a/pypy/module/micronumpy/arrayimpl/scalar.py b/pypy/module/micronumpy/arrayimpl/scalar.py
--- a/pypy/module/micronumpy/arrayimpl/scalar.py
+++ b/pypy/module/micronumpy/arrayimpl/scalar.py
@@ -37,6 +37,9 @@
     def get_scalar_value(self):
         return self.value
 
+    def set_scalar_value(self, w_val):
+        self.value = w_val.convert_to(self.dtype)
+
     def copy(self):
         scalar = Scalar(self.dtype)
         scalar.value = self.value
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
@@ -96,6 +96,9 @@
     def is_scalar(self):
         return self.implementation.is_scalar()
 
+    def set_scalar_value(self, w_val):
+        self.implementation.set_scalar_value(w_val)
+
     def fill(self, box):
         self.implementation.fill(box)
 


More information about the pypy-commit mailing list