[pypy-commit] pypy numpypy-complex2: do not demote complex to float

mattip noreply at buildbot.pypy.org
Fri Aug 24 16:41:47 CEST 2012


Author: mattip <matti.picus at gmail.com>
Branch: numpypy-complex2
Changeset: r56837:30d1879c3c04
Date: 2012-08-24 13:45 +0300
http://bitbucket.org/pypy/pypy/changeset/30d1879c3c04/

Log:	do not demote complex to float

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
@@ -444,6 +444,7 @@
     long_dtype = interp_dtype.get_dtype_cache(space).w_longdtype
     int64_dtype = interp_dtype.get_dtype_cache(space).w_int64dtype
     complex_type = interp_dtype.get_dtype_cache(space).w_complex128dtype
+    float_type = interp_dtype.get_dtype_cache(space).w_float64dtype
 
     if isinstance(w_obj, interp_boxes.W_GenericBox):
         dtype = w_obj.get_dtype(space)
@@ -468,7 +469,7 @@
     elif space.isinstance_w(w_obj, space.w_complex):
         if (current_guess is None or current_guess is bool_dtype or
             current_guess is long_dtype or current_guess is int64_dtype or
-            current_guess is complex_type):
+            current_guess is complex_type or current_guess is float_type):
             return complex_type
         return current_guess
 


More information about the pypy-commit mailing list