예제 #1
0
파일: test_rclass.py 프로젝트: alkorzt/pypy
 def fn_instance():
     a = ootype.new(A)
     obj = ootype.cast_to_object(a)
     a2 = ootype.cast_from_object(A, obj)
     a3 = ootype.cast_from_object(ootype.ROOT, obj)
     assert a is a2
     assert a is a3
예제 #2
0
 def fn_instance():
     a = ootype.new(A)
     obj = ootype.cast_to_object(a)
     a2 = ootype.cast_from_object(A, obj)
     a3 = ootype.cast_from_object(ootype.ROOT, obj)
     assert a is a2
     assert a is a3
예제 #3
0
파일: test_rclass.py 프로젝트: alkorzt/pypy
 def fn_null():
     a = ootype.null(A)
     b = ootype.null(B)
     obj1 = ootype.cast_to_object(a)
     obj2 = ootype.cast_to_object(b)
     assert obj1 == obj2
     assert ootype.cast_from_object(A, obj1) == a
     assert ootype.cast_from_object(B, obj2) == b
예제 #4
0
 def fn_null():
     a = ootype.null(A)
     b = ootype.null(B)
     obj1 = ootype.cast_to_object(a)
     obj2 = ootype.cast_to_object(b)
     assert obj1 == obj2
     assert ootype.cast_from_object(A, obj1) == a
     assert ootype.cast_from_object(B, obj2) == b
예제 #5
0
 def fn(flag):
     if flag:
         obj = obj1
     else:
         obj = obj2
     a3 = ootype.cast_from_object(A, obj)
     return a3 is a1
예제 #6
0
파일: constant.py 프로젝트: Debug-Orz/Sypy
 def fn(flag):
     if flag:
         obj = obj1
     else:
         obj = obj2
     a3 = ootype.cast_from_object(A, obj)
     return a3 is a1
예제 #7
0
파일: test_rclass.py 프로젝트: alkorzt/pypy
 def fn_record():
     b = ootype.new(B)
     b.x = 42
     obj = ootype.cast_to_object(b)
     b2 = ootype.cast_from_object(B, obj)
     assert b2.x == 42
     assert b is b2
예제 #8
0
 def fn_record():
     b = ootype.new(B)
     b.x = 42
     obj = ootype.cast_to_object(b)
     b2 = ootype.cast_from_object(B, obj)
     assert b2.x == 42
     assert b is b2
예제 #9
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)
예제 #10
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
예제 #11
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
예제 #12
0
 def getref(self, OBJ):
     return ootype.cast_from_object(OBJ, self.getref_base())
예제 #13
0
파일: history.py 프로젝트: jerroldgao/pypy
 def getref(self, OBJ):
     return ootype.cast_from_object(OBJ, self.getref_base())
예제 #14
0
파일: history.py 프로젝트: jerroldgao/pypy
 def _get_str(self):    # for debugging only
     from pypy.rpython.annlowlevel import hlstr
     return hlstr(ootype.cast_from_object(ootype.String, self.value))
예제 #15
0
파일: ooopimpl.py 프로젝트: Debug-Orz/Sypy
def op_cast_from_object(TYPE, obj):
    return ootype.cast_from_object(TYPE, obj)
예제 #16
0
파일: constant.py 프로젝트: Debug-Orz/Sypy
 def fn():
     s1 = ootype.cast_from_object(ootype.String, obj)
     return s1
예제 #17
0
 def cast_from_ref(self, TYPE, value):
     return ootype.cast_from_object(TYPE, value)
예제 #18
0
파일: ooopimpl.py 프로젝트: njues/Sypy
def op_cast_from_object(TYPE, obj):
    return ootype.cast_from_object(TYPE, obj)
예제 #19
0
 def _get_str(self):  # for debugging only
     from pypy.rpython.annlowlevel import hlstr
     return hlstr(ootype.cast_from_object(ootype.String, self.value))
예제 #20
0
 def cast_to_baseclass(self, value):
     return ootype.cast_from_object(ootype.ROOT, value)
예제 #21
0
 def fn():
     s1 = ootype.cast_from_object(ootype.String, obj)
     return s1