Author: Raffael Tfirst <[email protected]>
Branch: py3.5-async
Changeset: r85792:3c298e0da674
Date: 2016-07-21 17:29 +0200
http://bitbucket.org/pypy/pypy/changeset/3c298e0da674/

Log:    Fix arguments of descr_cast in memoryview, start implementing format
        check

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
@@ -196,10 +196,19 @@
             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
+    def get_native_fmtchar(self, fmt):
+        size = -1
+        if fmt[0] == '@':
+            f = fmt[1]
+        else:
+            f = fmt[0]
+        if f == 'c' or f == 'b' or f == 'B':
+            size = size
+    
+    def descr_cast(self, space, w_args, **w_kwds):
         self._check_released(space)
+        self.format = w_args
+        return self
 
 
 W_MemoryView.typedef = TypeDef(
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to