def _fget(self, attrchar): if attrchar == 'i': # item return self.space.wrap(self.ctitem) if attrchar == 'l': # length if self.length >= 0: return self.space.wrap(self.length) else: return self.space.w_None return W_CTypePtrOrArray._fget(self, attrchar)
def _fget(self, attrchar): if attrchar == 'i': # item return self.ctitem if attrchar == 'l': # length if self.length >= 0: return self.space.newint(self.length) else: return self.space.w_None return W_CTypePtrOrArray._fget(self, attrchar)
def __init__(self, space, ctptr, length, arraysize, extra): assert isinstance(ctptr, W_CTypePointer) W_CTypePtrOrArray.__init__(self, space, arraysize, extra, 0, ctptr.ctitem) self.length = length self.ctptr = ctptr
def __init__(self, space, ctptr, length, arraysize, extra): W_CTypePtrOrArray.__init__(self, space, arraysize, extra, 0, ctptr.ctitem) self.length = length self.ctptr = ctptr
def __init__(self, space, ctptr, length, arraysize, extra): assert isinstance(ctptr, W_CTypePointer) W_CTypePtrOrArray.__init__(self, space, arraysize, extra, 0, ctptr.ctitem) self.length = length # -1 if no length is given, e.g. 'int[]' self.ctptr = ctptr