Martin Wiechert wrote:
> Thanks Albert! Do you also know the corresponding C-API function? It cannot 
> be 
> PyArray_DescrConverter (PyObject *, PyArray_Descr **), whose signature has no 
> "align", right?
>   
The DescrConverter function is meant for "O&"-style conversions.  It 
can't accept an align function.  We could possibly add something to the 
converter to allow specification of alignment through the object to be 
converted.

Or, you can just call the __new__ method of the PyArrayDescr_Type object

res = PyObject_CallMethod((PyObject *)&PyArrayDescr_Type, "__new__", 
"Oi", dict_object, 1))

or call the tp->new method directly:

args = Py_BuildValue("Oi", dict_object, 1);
PyArrayDescr_Type->tp_new(&PyArrayDescr_Type, args, NULL);
Py_DECREF(args);

(I think passing in NULL for the keywords is O.K., but I haven't checked 
it).

-Travis


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to