Author: Philip Jenvey <[email protected]>
Branch: refactor-buffer-api
Changeset: r68264:943710084471
Date: 2013-11-20 15:14 -0800
http://bitbucket.org/pypy/pypy/changeset/943710084471/

Log:    just rename the descr_news so they don't clash

diff --git a/pypy/module/__builtin__/interp_memoryview.py 
b/pypy/module/__builtin__/interp_memoryview.py
--- a/pypy/module/__builtin__/interp_memoryview.py
+++ b/pypy/module/__builtin__/interp_memoryview.py
@@ -44,7 +44,7 @@
 
     @staticmethod
     @unwrap_spec(offset=int, size=int)
-    def descr_new(space, w_subtype, w_object, offset=0, size=-1):
+    def descr_new_buffer(space, w_subtype, w_object, offset=0, size=-1):
         if space.isinstance_w(w_object, space.w_unicode):
             # unicode objects support the old buffer interface
             # but not the new buffer interface (change in python 2.7)
@@ -72,8 +72,6 @@
         else:
             buf = buffer.SubBuffer(buf, offset, size)
         return W_Buffer(buf)
-    # hack to fix translation
-    descr_new.__get__('foo').__name__ = 'descr_new_buffer'
 
     def descr_len(self, space):
         return space.wrap(self.buf.getlength())
@@ -147,7 +145,7 @@
 start of the object (or at the specified offset). The slice will
 extend to the end of the target object (or with the specified size).
 """,
-    __new__ = interp2app(W_Buffer.descr_new),
+    __new__ = interp2app(W_Buffer.descr_new_buffer),
     __len__ = interp2app(W_Buffer.descr_len),
     __getitem__ = interp2app(W_Buffer.descr_getitem),
     __setitem__ = interp2app(W_Buffer.descr_setitem),
@@ -179,7 +177,7 @@
         return self.buf
 
     @staticmethod
-    def descr_new(space, w_subtype, w_object):
+    def descr_new_memoryview(space, w_subtype, w_object):
         w_memoryview = W_MemoryView(space.buffer_w(w_object))
         return w_memoryview
 
@@ -296,7 +294,7 @@
     __doc__ = """\
 Create a new memoryview object which references the given object.
 """,
-    __new__ = interp2app(W_MemoryView.descr_new),
+    __new__ = interp2app(W_MemoryView.descr_new_memoryview),
     __eq__      = interp2app(W_MemoryView.descr_eq),
     __ge__      = interp2app(W_MemoryView.descr_ge),
     __getitem__ = interp2app(W_MemoryView.descr_getitem),
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to