def fn(): a = ootype.new(A) ahash = ootype.identityhash(a) obj = ootype.cast_to_object(a) native = cast_to_native_object(obj) name = native.GetType().get_Name() obj2 = cast_from_native_object(native) a2 = ootype.cast_from_object(A, obj2) a2hash = ootype.identityhash(a2) return name, ahash == a2hash
def _cast_instance_to_native_obj(self, e): from rpython.rtyper.annlowlevel import cast_instance_to_base_obj inst = cast_instance_to_base_obj(e) # SomeOOInstance obj = ootype.cast_to_object(inst) # SomeOOObject return dotnet.cast_to_native_object(obj) # System.Object
def set_zero_division_error(self): exc_obj = ootype.cast_to_object(self.ll_zero_exc) exc_value = dotnet.cast_to_native_object(exc_obj) self.get_inputargs().set_exc_value(exc_value)
def set_overflow_error(self): exc_obj = ootype.cast_to_object(self.ll_ovf_exc) exc_value = dotnet.cast_to_native_object(exc_obj) self.get_inputargs().set_exc_value(exc_value)
def set_future_value_ref(self, index, objvalue): obj = dotnet.cast_to_native_object(objvalue) self.get_inputargs().set_obj(index, obj)
def get_cliobj(self): return dotnet.cast_to_native_object(self.getref_base())