예제 #1
0
 def immutable_unique_id(self, space):
     if self.w_instance is not None:
         return W_Root.immutable_unique_id(self, space)
     # the special-case is only for *unbound* method objects
     #
     from pypy.objspace.std.util import IDTAG_UNBOUND_METHOD as tag
     from pypy.objspace.std.util import IDTAG_SHIFT
     id = space.bigint_w(space.id(self.w_function))
     id = id.lshift(LONG_BIT).or_(space.bigint_w(space.id(self.w_class)))
     id = id.lshift(IDTAG_SHIFT).int_or_(tag)
     return space.newlong_from_rbigint(id)