1 Jan 2008 03:03
Re: Passing a Null pointer for numpy array
Lenard Lindstrom <len-l <at> telus.net>
2008-01-01 02:03:59 GMT
2008-01-01 02:03:59 GMT
Perhaps py_object would work provided the function borrows its references. The py_object() will create a null object pointer. nicholas cunliffe wrote: > If I understand your suggestion it would be to have multiple > references to the same DLL function func1, func2 etc each with its own > prototype? > > The problem in this case is that there are 7 array refs and so the > number of prototypes if each of them could be None or array ref and > any number could be null or ref then the number of prototypes would be > very large indeed. > > I think in general the prototype idea is good but for all but simple > cases runs into problems. I am having nothing but frustrations and > indeed have given up and have turned to void pointers (which check for > just about nothing). I have seen the Null or pointer issue come up > many times on user boards. Allowing more than 1 definition per > argument in the form (long | None) might be an idea. This would allow > other practical solutions like the option of using (ndarray | > ctypesarray) for example. > > Nicholas > > > On Dec 31, 2007 10:40 PM, Lenard Lindstrom <len-l <at> telus.net > <mailto:len-l <at> telus.net>> wrote: > > My mistake. T_ndDp is not a ctypes type so follows its own rules. If > you want to pass NULL to the function then declare the argument as(Continue reading)
RSS Feed