[pypy-commit] pypy numpy-dtype-refactor-complex: make things translate
alex_gaynor
noreply at buildbot.pypy.org
Tue Dec 6 20:28:21 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-refactor-complex
Changeset: r50221:894a554a8053
Date: 2011-12-06 14:25 -0500
http://bitbucket.org/pypy/pypy/changeset/894a554a8053/
Log: make things translate
diff --git a/pypy/module/micronumpy/compile.py b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -120,6 +120,9 @@
assert isinstance(w_obj, interp_boxes.W_GenericBox)
return self.int(w_obj.descr_int(self))
+ def unpackcomplex(self, w_obj):
+ raise NotImplementedError
+
def is_true(self, w_obj):
assert isinstance(w_obj, BoolObject)
return w_obj.boolval
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
@@ -61,9 +61,6 @@
# exp = sin = cos = tan = arcsin = arccos = arctan = arcsinh = \
# arctanh = _unimplemented_ufunc
- def is_correct_box(self, box):
- return isinstance(box, self.BoxType)
-
class Primitive(object):
_mixin_ = True
def get_element_size(self):
@@ -411,7 +408,9 @@
s += itemtype.get_element_size()
return s
+ @specialize.argtype(1)
def box(self, value):
+ assert isinstance(value, list)
return self.BoxType(value)
def unbox(self, box):
@@ -433,6 +432,9 @@
offset += itemtype.get_element_size()
return self.box(boxes)
+ def is_correct_box(self, box):
+ return isinstance(box, self.BoxType)
+
class Complex(BaseCompositeType):
BoxType = interp_boxes.W_Complex128Box
More information about the pypy-commit
mailing list