示例#1
0
文件: constant.py 项目: sota/pypy-old
 def fn(flag):
     if flag:
         obj = obj1
     else:
         obj = obj2
     a3 = ootype.cast_from_object(A, obj)
     return a3 is a1
示例#2
0
 def get_exception(self):
     exc_value = self.get_inputargs().get_exc_value()
     if exc_value:
         exc_obj = dotnet.cast_from_native_object(exc_value)
         exc_inst = ootype.cast_from_object(ootype.ROOT, exc_obj)
         cls = ootype.classof(exc_value)
         return ootype.cast_to_object(cls)
     return ootype.cast_to_object(ootype.nullruntimeclass)
示例#3
0
文件: runner.py 项目: sota/pypy
 def get_exception(self):
     exc_value = self.get_inputargs().get_exc_value()
     if exc_value:
         exc_obj = dotnet.cast_from_native_object(exc_value)
         exc_inst = ootype.cast_from_object(ootype.ROOT, exc_obj)
         cls = ootype.classof(exc_value)
         return ootype.cast_to_object(cls)
     return ootype.cast_to_object(ootype.nullruntimeclass)
示例#4
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
示例#5
0
文件: test_dotnet.py 项目: sota/pypy
 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
示例#6
0
文件: constant.py 项目: sota/pypy-old
 def fn():
     s1 = ootype.cast_from_object(ootype.String, obj)
     return s1
示例#7
0
文件: ooopimpl.py 项目: sota/pypy
def op_cast_from_object(TYPE, obj):
    return ootype.cast_from_object(TYPE, obj)
示例#8
0
def op_cast_from_object(TYPE, obj):
    return ootype.cast_from_object(TYPE, obj)