On Tue, Apr 18, 2017 at 3:58 AM, Rob Gaddi <rgaddi@highlandtechnology.invalid> wrote: > If I were writing this as a C extension, getting that information from any > buffer object would be trivial, but that changes my project from a pure > Python wrapper using ctypes to a mixed language project with compile > dependencies and mental headaches. > > buffertype = c_uint8 * size > return addressof(buffertype.from_buffer(buf, offset)) > > works but is inefficient and woefully inelegant.
Have you considered Cython? It can massively simplify a lot of the work in doing this kind of thing. ChrisA -- https://mail.python.org/mailman/listinfo/python-list