diff --git a/include/boost/python/numeric.hpp b/include/boost/python/numeric.hpp index 66fde676..ab4db8c3 100644 --- a/include/boost/python/numeric.hpp +++ b/include/boost/python/numeric.hpp @@ -92,6 +92,7 @@ namespace aux { static bool check(PyObject* obj); static detail::new_non_null_reference adopt(PyObject* obj); + static PyTypeObject const* get_pytype() ; }; } // namespace aux diff --git a/src/numeric.cpp b/src/numeric.cpp index 35c469c5..c8890bb8 100644 --- a/src/numeric.cpp +++ b/src/numeric.cpp @@ -114,6 +114,12 @@ namespace aux pytype_check(downcast(array_type.get()), obj)); } + PyTypeObject const* array_object_manager_traits::get_pytype() + { + load(false); + if(!array_type) return 0; + return handle(array_type).get(); + } # define BOOST_PYTHON_AS_OBJECT(z, n, _) object(x##n) # define BOOST_PP_LOCAL_MACRO(n) \ diff --git a/test/numpy.cpp b/test/numpy.cpp index 962a6a8c..e5da7c9b 100644 --- a/test/numpy.cpp +++ b/test/numpy.cpp @@ -16,7 +16,7 @@ using namespace boost::python; #endif // See if we can invoke array() from C++ -object new_array() +numeric::array new_array() { return numeric::array( make_tuple(