Beispiel #1
0
def HPy_GetItem_s(space, ctx, h_obj, key):
    w_obj = handles.deref(space, h_obj)
    w_key = API.ccharp2text(space, key)
    w_res = space.getitem(w_obj, w_key)
    return handles.new(space, w_res)
Beispiel #2
0
def HPy_SetAttr_s(space, ctx, h_obj, name, h_value):
    w_obj = handles.deref(space, h_obj)
    w_name = API.ccharp2text(space, name)
    w_value = handles.deref(space, h_value)
    operation.setattr(space, w_obj, w_name, w_value)
    return API.int(0)
Beispiel #3
0
def HPy_GetAttr_s(space, ctx, h_obj, name):
    w_obj = handles.deref(space, h_obj)
    w_name = API.ccharp2text(space, name)
    w_res = space.getattr(w_obj, w_name)
    return handles.new(space, w_res)
Beispiel #4
0
def HPy_HasAttr_s(space, ctx, h_obj, name):
    w_obj = handles.deref(space, h_obj)
    w_name = API.ccharp2text(space, name)
    return _HasAttr(space, w_obj, w_name)
Beispiel #5
0
def HPy_SetItem_s(space, ctx, h_obj, key, h_val):
    w_obj = handles.deref(space, h_obj)
    w_key = API.ccharp2text(space, key)
    w_val = handles.deref(space, h_val)
    space.setitem(w_obj, w_key, w_val)
    return API.int(0)