<div dir="ltr">Hi Valentin,<br><br><div><div class="gmail_extra"><div class="gmail_quote">On 8 October 2013 13:23, Valentin Haenel <span dir="ltr"><<a href="mailto:valentin@haenel.co" target="_blank">valentin@haenel.co</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Certain functions, like<br>
`PyArray_SimpleNewFromData` `PyArray_SimpleNew` take a typeenum<br>Is there any way to go from typeenum to something that can be<br>
passed to the dtype constructor, like mapping 12 -> '<f8'?<br></blockquote><div><br></div><div>If you just want the corresponding dtype instance (aka PyArray_Descr) then `PyArray_DescrFromType` should be what you're after.<br>
<br></div><div>But if you really need the '<f8' string then I'd be tempted to get the PyArray_Descr and then use the Python API (e.g. PyObject_GetAttrString) to request the "str" attribute. Under the hood this attribute is implemented by `arraydescr_protocol_typestr_get` but that's not part of the public API.<br>
<br></div><div>Regards,<br>Richard Hattersley<br></div></div></div></div></div>