[pypy-commit] pypy buffer-cleanup: Add W_ArrayBase.buffer_w()

rlamy pypy.commits at gmail.com
Sun Feb 5 11:31:57 EST 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: buffer-cleanup
Changeset: r89942:1ed5b196b55d
Date: 2017-02-05 16:31 +0000
http://bitbucket.org/pypy/pypy/changeset/1ed5b196b55d/

Log:	Add W_ArrayBase.buffer_w()

diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -256,8 +256,12 @@
         if oldbuffer:
             lltype.free(oldbuffer, flavor='raw')
 
+    def buffer_w(self, space, flags):
+        return ArrayBuffer(self, False)
+
     def buffer_w_ex(self, space, flags):
-        return ArrayBuffer(self, False), self.typecode, self.itemsize
+        buf = self.buffer_w(space, flags)
+        return buf, buf.getformat(), buf.getitemsize()
 
     def descr_append(self, space, w_x):
         """ append(x)


More information about the pypy-commit mailing list