Author: Ronan Lamy <[email protected]>
Branch: PyBuffer
Changeset: r91040:459611e8d6b4
Date: 2017-04-11 17:58 +0100
http://bitbucket.org/pypy/pypy/changeset/459611e8d6b4/
Log: fix BufferSlice.w_getitem()
diff --git a/pypy/objspace/std/memoryobject.py
b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -687,6 +687,15 @@
def getstrides(self):
return self.strides
+ def parent_index(self, idx):
+ return self.offset + self.step * idx
+
+ def w_getitem(self, space, idx):
+ return self.buf.w_getitem(space, self.parent_index(idx))
+
+ def setitem_w(self, space, idx, w_obj):
+ return self.buf.setitem_w(space, self.parent_index(idx), w_obj)
+
class BufferViewBase(Buffer):
_immutable_ = True
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit