[pypy-svn] pypy default: (fijal, arigo)

arigo commits-noreply at bitbucket.org
Thu Jan 20 15:22:05 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41032:59e39261e52c
Date: 2011-01-20 15:03 +0100
http://bitbucket.org/pypy/pypy/changeset/59e39261e52c/

Log:	(fijal, arigo)

	Give up on space.wrap(rbigint(..)) and implement
	space.newlong_from_rbigint().

diff --git a/pypy/module/__builtin__/functional.py b/pypy/module/__builtin__/functional.py
--- a/pypy/module/__builtin__/functional.py
+++ b/pypy/module/__builtin__/functional.py
@@ -132,7 +132,7 @@
     res_w = [None] * howmany
     v = start
     for idx in range(howmany):
-        res_w[idx] = space.wrap(v)
+        res_w[idx] = space.newlong_from_rbigint(v)
         v = v.add(step)
     return space.newlist(res_w)
 

diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -182,8 +182,6 @@
                 return self.newint(x)
             else:
                 return W_LongObject.fromrarith_int(x)
-        if isinstance(x, rbigint):
-            return W_LongObject(x)
         return self._wrap_not_rpython(x)
     wrap._annspecialcase_ = "specialize:wrap"
 
@@ -273,6 +271,9 @@
     def newlong(self, val): # val is an int
         return W_LongObject.fromint(self, val)
 
+    def newlong_from_rbigint(self, val):
+        return W_LongObject(val)
+
     def newtuple(self, list_w):
         assert isinstance(list_w, list)
         make_sure_not_resized(list_w)


More information about the Pypy-commit mailing list