Beispiel #1
0
 def getslice(self, start, step, size):
     if size == 0:
         return ''
     if step == 1:
         data = self.w_array._charbuf_start()
         try:
             return rffi.charpsize2str(rffi.ptradd(data, start), size)
         finally:
             self.w_array._charbuf_stop()
     return RawBuffer.getslice(self, start, step, size)
Beispiel #2
0
 def getslice(self, start, stop, step, size):
     if step == 1:
         return rffi.charpsize2str(rffi.ptradd(self.raw_cdata, start), size)
     return RawBuffer.getslice(self, start, stop, step, size)
Beispiel #3
0
 def getslice(self, start, stop, step, size):
     self.check_valid()
     if step == 1:
         return self.mmap.getslice(start, size)
     else:
         return RawBuffer.getslice(self, start, stop, step, size)