[pypy-svn] r14952 - pypy/dist/pypy/objspace/std

pedronis at codespeak.net pedronis at codespeak.net
Sat Jul 23 02:26:28 CEST 2005


Author: pedronis
Date: Sat Jul 23 02:26:27 2005
New Revision: 14952

Modified:
   pypy/dist/pypy/objspace/std/longtype.py
   pypy/dist/pypy/objspace/std/objspace.py
   pypy/dist/pypy/objspace/std/strutil.py
Log:
now W_LongObject.digits are just ints



Modified: pypy/dist/pypy/objspace/std/longtype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longtype.py	(original)
+++ pypy/dist/pypy/objspace/std/longtype.py	Sat Jul 23 02:26:27 2005
@@ -3,7 +3,6 @@
 from pypy.interpreter.error import OperationError
 from pypy.objspace.std.inttype import int_typedef
 from pypy.interpreter.gateway import NoneNotWrapped
-from pypy.rpython.rarithmetic import r_uint
 
 def descr__new__(space, w_longtype, w_x=0, w_base=NoneNotWrapped):
     from pypy.objspace.std.longobject import W_LongObject, args_from_long
@@ -44,7 +43,7 @@
                     sign = 1
                 else:
                     sign = 0
-                w_value = W_LongObject(space, [r_uint(abs(intval))], sign) 
+                w_value = W_LongObject(space, [abs(intval)], sign) 
             else:
                 raise OperationError(space.w_ValueError,
                                     space.wrap("value can't be converted to long"))

Modified: pypy/dist/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objspace.py	(original)
+++ pypy/dist/pypy/objspace/std/objspace.py	Sat Jul 23 02:26:27 2005
@@ -260,12 +260,12 @@
     def newfloat(self, floatval):
         return W_FloatObject(self, floatval)
 
-    def newlong(self, uint): # for now just take a r_uint
-        if uint == 0:
+    def newlong(self, val): # val is an int
+        if val == 0:
             sign = 0
         else:
             sign = 1
-        return W_LongObject(self, [uint], sign)
+        return W_LongObject(self, [val], sign)
         
     def newtuple(self, list_w):
         assert isinstance(list_w, list)

Modified: pypy/dist/pypy/objspace/std/strutil.py
==============================================================================
--- pypy/dist/pypy/objspace/std/strutil.py	(original)
+++ pypy/dist/pypy/objspace/std/strutil.py	Sat Jul 23 02:26:27 2005
@@ -124,8 +124,8 @@
         p = NumberStringParser(s, literal, base, 'long')
     else:
         p = parser
-    w_base = space.newlong(r_uint(p.base))
-    w_result = space.newlong(r_uint(0))
+    w_base = space.newlong(p.base)
+    w_result = space.newlong(0)
     while True:
         digit = p.next_digit()
         if digit == -1:
@@ -135,7 +135,7 @@
             from pypy.objspace.std.longobject import W_LongObject
             assert isinstance(w_result, W_LongObject)
             return w_result
-        w_result = space.add(space.mul(w_result,w_base),space.newlong(r_uint(digit)))
+        w_result = space.add(space.mul(w_result,w_base), space.newlong(digit))
 
 def break_up_float(s):
     i = 0



More information about the Pypy-commit mailing list