[pypy-commit] pypy default: wrapint -> space.newint
pjenvey
noreply at buildbot.pypy.org
Fri Aug 16 02:08:53 CEST 2013
Author: Philip Jenvey <pjenvey at underboss.org>
Branch:
Changeset: r66170:b9e203336e31
Date: 2013-08-15 17:07 -0700
http://bitbucket.org/pypy/pypy/changeset/b9e203336e31/
Log: wrapint -> space.newint
diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -7,7 +7,6 @@
from pypy.objspace.std.bytearraytype import (
getbytevalue, makebytearraydata_w, new_bytearray)
from pypy.objspace.std.intobject import W_IntObject
-from pypy.objspace.std.inttype import wrapint
from pypy.objspace.std.model import W_Object, registerimplementation
from pypy.objspace.std.multimethod import FailedToImplement
from pypy.objspace.std.noneobject import W_NoneObject
@@ -76,7 +75,7 @@
def len__Bytearray(space, w_bytearray):
result = len(w_bytearray.data)
- return wrapint(space, result)
+ return space.newint(result)
def ord__Bytearray(space, w_bytearray):
if len(w_bytearray.data) != 1:
diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py
--- a/pypy/objspace/std/intobject.py
+++ b/pypy/objspace/std/intobject.py
@@ -1,6 +1,6 @@
from pypy.interpreter.error import OperationError
from pypy.objspace.std import newformat
-from pypy.objspace.std.inttype import wrapint, W_AbstractIntObject
+from pypy.objspace.std.inttype import W_AbstractIntObject
from pypy.objspace.std.model import registerimplementation, W_Object
from pypy.objspace.std.multimethod import FailedToImplementArgs
from pypy.objspace.std.noneobject import W_NoneObject
@@ -55,7 +55,7 @@
if space.is_w(space.type(self), space.w_int):
return self
a = self.intval
- return wrapint(space, a)
+ return space.newint(a)
registerimplementation(W_IntObject)
@@ -104,7 +104,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer addition"))
- return wrapint(space, z)
+ return space.newint(z)
def sub__Int_Int(space, w_int1, w_int2):
x = w_int1.intval
@@ -114,7 +114,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer substraction"))
- return wrapint(space, z)
+ return space.newint(z)
def mul__Int_Int(space, w_int1, w_int2):
x = w_int1.intval
@@ -124,7 +124,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer multiplication"))
- return wrapint(space, z)
+ return space.newint(z)
def floordiv__Int_Int(space, w_int1, w_int2):
x = w_int1.intval
@@ -137,7 +137,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer division"))
- return wrapint(space, z)
+ return space.newint(z)
div__Int_Int = floordiv__Int_Int
def truediv__Int_Int(space, w_int1, w_int2):
@@ -158,7 +158,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer modulo"))
- return wrapint(space, z)
+ return space.newint(z)
def divmod__Int_Int(space, w_int1, w_int2):
x = w_int1.intval
@@ -231,7 +231,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer negation"))
- return wrapint(space, x)
+ return space.newint(x)
get_negint = neg__Int
@@ -247,7 +247,7 @@
def invert__Int(space, w_int1):
x = w_int1.intval
a = ~x
- return wrapint(space, a)
+ return space.newint(a)
def lshift__Int_Int(space, w_int1, w_int2):
a = w_int1.intval
@@ -258,7 +258,7 @@
except OverflowError:
raise FailedToImplementArgs(space.w_OverflowError,
space.wrap("integer left shift"))
- return wrapint(space, c)
+ return space.newint(c)
if b < 0:
raise OperationError(space.w_ValueError,
space.wrap("negative shift count"))
@@ -284,25 +284,25 @@
a = 0
else:
a = a >> b
- return wrapint(space, a)
+ return space.newint(a)
def and__Int_Int(space, w_int1, w_int2):
a = w_int1.intval
b = w_int2.intval
res = a & b
- return wrapint(space, res)
+ return space.newint(res)
def xor__Int_Int(space, w_int1, w_int2):
a = w_int1.intval
b = w_int2.intval
res = a ^ b
- return wrapint(space, res)
+ return space.newint(res)
def or__Int_Int(space, w_int1, w_int2):
a = w_int1.intval
b = w_int2.intval
res = a | b
- return wrapint(space, res)
+ return space.newint(res)
def pos__Int(self, space):
return self.int(space)
@@ -323,7 +323,7 @@
return space.wrap(hex(w_int1.intval))
def getnewargs__Int(space, w_int1):
- return space.newtuple([wrapint(space, w_int1.intval)])
+ return space.newtuple([space.newint(w_int1.intval)])
register_all(vars())
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -19,7 +19,6 @@
from pypy.objspace.std import slicetype
from pypy.objspace.std.floatobject import W_FloatObject
from pypy.objspace.std.intobject import W_IntObject
-from pypy.objspace.std.inttype import wrapint
from pypy.objspace.std.iterobject import (W_FastListIterObject,
W_ReverseSeqIterObject)
from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice
@@ -427,7 +426,7 @@
def descr_len(self, space):
result = self.length()
- return wrapint(space, result)
+ return space.newint(result)
def descr_iter(self, space):
return W_FastListIterObject(self)
diff --git a/pypy/objspace/std/stringobject.py b/pypy/objspace/std/stringobject.py
--- a/pypy/objspace/std/stringobject.py
+++ b/pypy/objspace/std/stringobject.py
@@ -4,7 +4,6 @@
from pypy.interpreter.error import OperationError, operationerrfmt
from pypy.objspace.std import newformat, slicetype
from pypy.objspace.std.formatting import mod_format
-from pypy.objspace.std.inttype import wrapint
from pypy.objspace.std.model import W_Object, registerimplementation
from pypy.objspace.std.multimethod import FailedToImplement
from pypy.objspace.std.noneobject import W_NoneObject
@@ -589,7 +588,7 @@
def str_count__String_String_ANY_ANY(space, w_self, w_arg, w_start, w_end):
u_self, u_start, u_end = _convert_idx_params(space, w_self, w_start, w_end)
- return wrapint(space, u_self.count(w_arg._value, u_start, u_end))
+ return space.newint(u_self.count(w_arg._value, u_start, u_end))
def str_endswith__String_String_ANY_ANY(space, w_self, w_suffix, w_start, w_end):
(u_self, start, end) = _convert_idx_params(space, w_self, w_start,
@@ -709,7 +708,7 @@
def hash__String(space, w_str):
s = w_str._value
x = compute_hash(s)
- return wrapint(space, x)
+ return space.newint(x)
def lt__String_String(space, w_str1, w_str2):
s1 = w_str1._value
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -7,7 +7,6 @@
from pypy.interpreter.gateway import (
WrappedDefault, interp2app, interpindirect2app, unwrap_spec)
from pypy.objspace.std import slicetype
-from pypy.objspace.std.inttype import wrapint
from pypy.objspace.std.sliceobject import W_SliceObject, normalize_simple_slice
from pypy.objspace.std.stdtypedef import StdTypeDef
from pypy.objspace.std.util import negate
@@ -56,7 +55,7 @@
def descr_len(self, space):
result = self.length()
- return wrapint(space, result)
+ return space.newint(result)
def descr_iter(self, space):
from pypy.objspace.std import iterobject
More information about the pypy-commit
mailing list