def getslice(self, start, stop, step, size): if step == 1: data = self.array._charbuf_start() try: return rffi.charpsize2str(rffi.ptradd(data, start), size) finally: self.array._charbuf_stop() return Buffer.getslice(self, start, stop, step, size)
def getslice(self, start, stop, step, size): if size == 0: return "" if step == 1: assert 0 <= start <= stop if start == 0 and stop == len(self.data): return "".join(self.data) return "".join(self.data[start:stop]) return Buffer.getslice(self, start, stop, step, size)
def getslice(self, start, stop, step, size): if size == 0: return '' if step == 1: data = self.array._charbuf_start() try: return rffi.charpsize2str(rffi.ptradd(data, start), size) finally: self.array._charbuf_stop() return Buffer.getslice(self, start, stop, step, size)
def getslice(self, start, stop, step, size): self.check_valid() if step == 1: return self.mmap.getslice(start, size) else: return Buffer.getslice(self, start, stop, step, size)
def getslice(self, start, stop, step, size): if step == 1: return rffi.charpsize2str(rffi.ptradd(self.raw_cdata, start), size) return Buffer.getslice(self, start, stop, step, size)