예제 #1
0
def w_root_as_pyobj(w_obj, space):
    from rpython.rlib.debug import check_annotation
    # make sure that translation crashes if we see this while not translating
    # with cpyext
    check_annotation(space.config.objspace.usemodules.cpyext, check_true)
    # default implementation of _cpyext_as_pyobj
    return rawrefcount.from_obj(PyObject, w_obj)
예제 #2
0
 def _get_full_list(self):
     res = [None] * size
     for i, attr in unrolling_enumerate_attrs:
         elem = getattr(self, attr)
         if nonull:
             debug.check_annotation(elem, _not_null)
         res[i] = getattr(self, attr)
     return res
예제 #3
0
 def _get_list(self, i):
     for j, attr in unrolling_enumerate_attrs:
         if j == i:
             result = getattr(self, attr)
             if nonull:
                 debug.check_annotation(result, _not_null)
             return result
     raise IndexError
예제 #4
0
파일: small_list.py 프로젝트: pycket/pycket
 def _get_full_list(self):
     res = [None] * size
     for i, attr in unrolling_enumerate_attrs:
         elem = getattr(self, attr)
         if nonull:
             debug.check_annotation(elem, _not_null)
         res[i] = getattr(self, attr)
     return res
예제 #5
0
파일: small_list.py 프로젝트: pycket/pycket
 def _get_list(self, i):
     for j, attr in unrolling_enumerate_attrs:
         if j == i:
             result = getattr(self, attr)
             if nonull:
                 debug.check_annotation(result, _not_null)
             return result
     raise IndexError
예제 #6
0
파일: test_debug.py 프로젝트: Darriall/pypy
 def g(x):
     check_annotation(x, checker)
     return x
예제 #7
0
파일: test_debug.py 프로젝트: Darriall/pypy
 def f(x):
     result = [x]
     check_annotation(result, checker)
     return result
예제 #8
0
 def g(x):
     check_annotation(x, checker)
     return x
예제 #9
0
 def f(x):
     result = [x]
     check_annotation(result, checker)
     return result
예제 #10
0
def w_root_attach_pyobj(w_obj, space, py_obj):
    from rpython.rlib.debug import check_annotation
    check_annotation(space.config.objspace.usemodules.cpyext, check_true)
    assert space.config.objspace.usemodules.cpyext
    # default implementation of _cpyext_attach_pyobj
    rawrefcount.create_link_pypy(w_obj, py_obj)