[pypy-commit] pypy numpy-dtype-refactor-complex: progress

alex_gaynor noreply at buildbot.pypy.org
Sun Dec 4 20:15:40 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-refactor-complex
Changeset: r50144:82e1fc9c253c
Date: 2011-12-04 14:15 -0500
http://bitbucket.org/pypy/pypy/changeset/82e1fc9c253c/

Log:	progress

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
@@ -43,6 +43,7 @@
     w_bool = "bool"
     w_int = "int"
     w_float = "float"
+    w_complex = "complex"
     w_list = "list"
     w_long = "long"
     w_tuple = 'tuple'
diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -257,6 +257,7 @@
     bool_dtype = interp_dtype.get_dtype_cache(space).w_booldtype
     long_dtype = interp_dtype.get_dtype_cache(space).w_longdtype
     int64_dtype = interp_dtype.get_dtype_cache(space).w_int64dtype
+    complex128_dtype = interp_dtype.get_dtype_cache(space).w_complex128dtype
 
     if isinstance(w_obj, interp_boxes.W_GenericBox):
         dtype = w_obj.get_dtype(space)
@@ -278,6 +279,8 @@
             current_guess is long_dtype or current_guess is int64_dtype):
             return int64_dtype
         return current_guess
+    elif space.isinstance_w(w_obj, space.w_complex):
+        return complex128_dtype
     return interp_dtype.get_dtype_cache(space).w_float64dtype
 
 
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
@@ -1039,7 +1039,6 @@
         a = zeros((10, 10))
         b = a[0].copy()
         assert (b == zeros(10)).all()
->>>>>>> other
 
 class AppTestSupport(BaseNumpyAppTest):
     def setup_class(cls):


More information about the pypy-commit mailing list