Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: numpy-ctypes
Changeset: r79842:3c27bfa5ee10
Date: 2015-09-25 18:43 +0100
http://bitbucket.org/pypy/pypy/changeset/3c27bfa5ee10/

Log:    Implement array.ctypes

diff --git a/pypy/module/micronumpy/ndarray.py 
b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -747,8 +747,12 @@
         return out
 
     def descr_get_ctypes(self, space):
-        raise OperationError(space.w_NotImplementedError, space.wrap(
-            "ctypes not implemented yet"))
+        w_result = space.appexec([self], """(w_array):
+            from numpy.core import _internal
+            p_data = self.__array_interface__['data'][0]
+            return _internal.ctypes(self, p_data)
+        """)
+        return w_result
 
     def buffer_w(self, space, flags):
         return self.implementation.get_buffer(space, True)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to