Skip to content
Snippets Groups Projects
Verified Commit 10beaf23 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

user type: add dtype property

parent 6f588fa2
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,11 @@ namespace eigenpy
const int code = call_PyArray_RegisterDataType(descr_ptr);
assert(code >= 0 && "The return code should be positive");
PyArray_Descr * new_descr = call_PyArray_DescrFromType(code);
if(PyDict_SetItemString(py_type_ptr->tp_dict,"dtype",(PyObject*)descr_ptr) < 0)
{
throw std::invalid_argument("PyDict_SetItemString fails.");
}
instance().type_to_py_type_bindings.insert(std::make_pair(type_info_ptr,py_type_ptr));
instance().py_array_descr_bindings[py_type_ptr] = new_descr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment