edmBernard / pybind11_opencv_numpy

Implementation of cv::Mat conversion to numpy.array for pybind11
Apache License 2.0
198 stars 41 forks source link

Update ndarray_converter.h #24

Closed perara closed 3 years ago

perara commented 3 years ago

Using inheritance instead of the macro.

edmBernard commented 3 years ago

I don't think your change is equivalent. type_caster already inherite from type_caster_base pybind11 code and the macro allow to define other things like the python name etc ...

maybe I'm too conservative but I prefer too keep the macro as long as the documentation of pybind11 use it to explain how to create custom type caster. pybind11 doc