Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
 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
Exemple #4
0
 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)
Exemple #5
0
 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)
Exemple #6
0
 def set_future_value_ref(self, index, objvalue):
     obj = dotnet.cast_to_native_object(objvalue)
     self.get_inputargs().set_obj(index, obj)
Exemple #7
0
 def get_cliobj(self):
     return dotnet.cast_to_native_object(self.getref_base())
Exemple #8
0
 def get_cliobj(self):
     return dotnet.cast_to_native_object(self.getref_base())
Exemple #9
0
 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
Exemple #10
0
 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)
Exemple #11
0
 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)
Exemple #12
0
 def set_future_value_ref(self, index, objvalue):
     obj = dotnet.cast_to_native_object(objvalue)
     self.get_inputargs().set_obj(index, obj)