Ken Watford, 21.07.2010 00:09:
Is there any way to expose the PEP 3118 buffer interface for objects that aren't extension types?
Given that it's a pure C-level interface, I don't think there would be much use for that.
Currently, I can expose the NumPy array interface (using either __array_interface__ or __array_struct__) for any class, extension or otherwise. But I can't find any reference to python-side interfacing for PEP 3118. SWIG makes an extension module for your wrapped code, but not extension *types*, so the classes it produces are pure-python with methods added in from the extension module.
Try using Cython instead, it has native support for the buffer protocol. Stefan -- http://mail.python.org/mailman/listinfo/python-list