On Sun, Oct 9, 2016 at 12:40 AM, Alex Mohr <am...@pixar.com> wrote: > > Instead of depending on numpy, we made our array structures implement the > python buffer protocol. This lets clients that wish to use numpy do so > easily, since numpy supports the buffer protocol, but it does not burden > those that don't with the numpy dependency. We did this manually of course > but supporting the buffer protocol would be a cool feature for boost.python.
I think this is a very good idea - it wasn't available as an option back when these NumPy bindings were written, but it's certainly the way I'd recommend writing them now if we were starting over. That would also eliminate the need to call an initialization function in any Python modules that use the NumPy bindings - failure to do that is by far the most common problem people have in using the NumPy bindings. That said, I think it'd be a fair amount of work to rewrite most of the library's functionality with no NumPy dependency, and I think some parts of it - like constructing numpy.dtype objects that correspond to C++ types - would probably be impossible to do without access to the NumPy C API, so we'd have to remove some functionality as well. Jim
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig