Author: Manuel Jacob
Branch: 
Changeset: r70083:f2302918495d
Date: 2014-03-19 07:25 +0100
http://bitbucket.org/pypy/pypy/changeset/f2302918495d/

Log:    Kill W_MemoryView.descr_buffer() and move the comment to
        W_MemoryView.buffer_w().

diff --git a/pypy/objspace/std/memoryview.py b/pypy/objspace/std/memoryview.py
--- a/pypy/objspace/std/memoryview.py
+++ b/pypy/objspace/std/memoryview.py
@@ -176,6 +176,14 @@
         self.buf = buf
 
     def buffer_w(self, space):
+        """
+        Note that memoryview() is very inconsistent in CPython: it does not
+        support the buffer interface but does support the new buffer
+        interface: as a result, it is possible to pass memoryview to
+        e.g. socket.send() but not to file.write().  For simplicity and
+        consistency, in PyPy memoryview DOES support buffer(), which means
+        that it is accepted in more places than CPython.
+        """
         return self.buf
 
     @staticmethod
@@ -229,17 +237,6 @@
             buf = buffer.SubBuffer(buf, start, size)
         return W_MemoryView(buf)
 
-    def descr_buffer(self, space):
-        """
-        Note that memoryview() is very inconsistent in CPython: it does not
-        support the buffer interface but does support the new buffer
-        interface: as a result, it is possible to pass memoryview to
-        e.g. socket.send() but not to file.write().  For simplicity and
-        consistency, in PyPy memoryview DOES support buffer(), which means
-        that it is accepted in more places than CPython.
-        """
-        return space.wrap(self.buf)
-
     def descr_tobytes(self, space):
         return space.wrap(self.as_str())
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to