示例#1
0
 def unique_id(self, space):
     if self.user_overridden_class:
         return W_Object.unique_id(self, space)
     from pypy.objspace.std.model import IDTAG_INT as tag
     b = space.bigint_w(self)
     b = b.lshift(3).or_(rbigint.fromint(tag))
     return space.newlong_from_rbigint(b)
示例#2
0
 def unique_id(self, space):
     if self.user_overridden_class:
         return W_Object.unique_id(self, space)
     from pypy.rlib.longlong2float import float2longlong
     from pypy.objspace.std.model import IDTAG_FLOAT as tag
     val = float2longlong(space.float_w(self))
     b = rbigint.fromrarith_int(val)
     b = b.lshift(3).or_(rbigint.fromint(tag))
     return space.newlong_from_rbigint(b)
示例#3
0
 def unique_id(self, space):
     if self.user_overridden_class:
         return W_Object.unique_id(self, space)
     from pypy.rlib.longlong2float import float2longlong
     from pypy.objspace.std.model import IDTAG_COMPLEX as tag
     real = space.float_w(space.getattr(self, space.wrap("real")))
     imag = space.float_w(space.getattr(self, space.wrap("imag")))
     real_b = rbigint.fromrarith_int(float2longlong(real))
     imag_b = rbigint.fromrarith_int(float2longlong(imag))
     val = real_b.lshift(64).or_(imag_b).lshift(3).or_(rbigint.fromint(tag))
     return space.newlong_from_rbigint(val)
示例#4
0
 def unique_id(self, space):
     if self.user_overridden_class:
         return W_Object.unique_id(self, space)
     return space.wrap(compute_unique_id(space.str_w(self)))