Author: Carl Friedrich Bolz <cfb...@gmx.de>
Branch: space-newtext
Changeset: r88730:7b943d7552ef
Date: 2016-11-28 16:15 +0100
http://bitbucket.org/pypy/pypy/changeset/7b943d7552ef/

Log:    remove space.wrap in array

diff --git a/pypy/module/array/interp_array.py 
b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -846,10 +846,16 @@
             if mytype.typecode in 'bBhHil':
                 item = rffi.cast(lltype.Signed, item)
                 return space.newint(item)
-            elif mytype.typecode == 'f':
+            if mytype.typecode in 'IL':
+                return space.newint(item)
+            elif mytype.typecode in 'fd':
                 item = float(item)
                 return space.newfloat(item)
-            return space.wrap(item) # YYY
+            elif mytype.typecode == 'c':
+                return space.newbytes(item)
+            elif mytype.typecode == 'u':
+                return space.newunicode(item)
+            assert 0, "unreachable"
 
         # interface
 
diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py
--- a/pypy/objspace/fake/objspace.py
+++ b/pypy/objspace/fake/objspace.py
@@ -171,6 +171,7 @@
         W_SliceObject(w_start, w_end, w_step)
         return w_some_obj()
 
+    @specialize.argtype(1)
     def newint(self, x):
         return w_some_obj()
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to