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)
Exemple #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
Exemple #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
Exemple #4
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
Exemple #5
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
Exemple #6
0
 def g(x):
     check_annotation(x, checker)
     return x
Exemple #7
0
 def f(x):
     result = [x]
     check_annotation(result, checker)
     return result
 def g(x):
     check_annotation(x, checker)
     return x
 def f(x):
     result = [x]
     check_annotation(result, checker)
     return result
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)