[pypy-commit] pypy PyBuffer-backport: Add missing W_MemoryView.copy()

rlamy pypy.commits at gmail.com
Wed May 10 14:15:58 EDT 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: PyBuffer-backport
Changeset: r91224:ed953d9e05ef
Date: 2017-05-10 19:15 +0100
http://bitbucket.org/pypy/pypy/changeset/ed953d9e05ef/

Log:	Add missing W_MemoryView.copy()

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
@@ -128,6 +128,12 @@
         else:
             raise TypeError("memoryview: invalid slice key")
 
+    @staticmethod
+    def copy(w_view):
+        # TODO suboffsets
+        view = w_view.view
+        return W_MemoryView(view)
+
     def descr_setitem(self, space, w_index, w_obj):
         self._check_released(space)
         if self.view.readonly:


More information about the pypy-commit mailing list