Author: Raffael Tfirst <raffael.tfi...@gmail.com>
Branch: py3.5-async
Changeset: r85785:bf2cf63e4730
Date: 2016-07-20 22:19 +0200
http://bitbucket.org/pypy/pypy/changeset/bf2cf63e4730/

Log:    Start implementing cast in memoryobject (change from cpython 3.3)

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
@@ -195,6 +195,11 @@
                    "is internally %r" % (self.buf,))
             raise OperationError(space.w_ValueError, space.wrap(msg))
         return space.wrap(rffi.cast(lltype.Signed, ptr))
+    
+    def descr_cast(self, space, *args, **kwds):
+        kwlist = ["format", "shape", None]
+        ndim = 1
+        self._check_released(space)
 
 
 W_MemoryView.typedef = TypeDef(
@@ -213,6 +218,7 @@
     __enter__   = interp2app(W_MemoryView.descr_enter),
     __exit__    = interp2app(W_MemoryView.descr_exit),
     __weakref__ = make_weakref_descr(W_MemoryView),
+    cast        = interp2app(W_MemoryView.descr_cast),
     tobytes     = interp2app(W_MemoryView.descr_tobytes),
     tolist      = interp2app(W_MemoryView.descr_tolist),
     release     = interp2app(W_MemoryView.descr_release),
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to