Author: mattip <[email protected]>
Branch:
Changeset: r78542:9eb2238aaf11
Date: 2015-07-13 00:37 +0300
http://bitbucket.org/pypy/pypy/changeset/9eb2238aaf11/
Log: missed this file in 1f1d7e1c14c2
diff --git a/pypy/module/micronumpy/concrete.py
b/pypy/module/micronumpy/concrete.py
--- a/pypy/module/micronumpy/concrete.py
+++ b/pypy/module/micronumpy/concrete.py
@@ -617,15 +617,17 @@
self.impl = impl
self.readonly = readonly
- def getitem(self, item):
- return raw_storage_getitem(lltype.Char, self.impl.storage, item)
+ def getitem(self, index):
+ return raw_storage_getitem(lltype.Char, self.impl.storage,
+ index + self.impl.start)
- def setitem(self, item, v):
- raw_storage_setitem(self.impl.storage, item,
+ def setitem(self, index, v):
+ raw_storage_setitem(self.impl.storage, index + self.impl.start,
rffi.cast(lltype.Char, v))
def getlength(self):
- return self.impl.size
+ return self.impl.size - self.impl.start
def get_raw_address(self):
- return self.impl.storage
+ from rpython.rtyper.lltypesystem import rffi
+ return rffi.ptradd(self.impl.storage, self.impl.start)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit