[Numpy-discussion] Fixing #736 and possible memory leak

Travis E. Oliphant oliphant at enthought.com
Fri Apr 25 10:27:43 EDT 2008


>
> So on and so forth. The problem is this bit of code (among others)
>
>     stop_at_string = ((type == PyArray_OBJECT) ||
>                       (type == PyArray_STRING &&
>                        typecode->type == PyArray_STRINGLTR) ||
>                       (type == PyArray_UNICODE) ||
>                       (type == PyArray_VOID));
>
>
> The question is, how do we interpret a string when the type is 
> specified? I think in that case we should try to convert the string to 
> the relevant type, just as we cast numbers to the relevant type. So we 
> should always stop at string.
>

The extra test there is to not stop at the string when the typecode is 
'c' (this is to ensure the behavior of 'c' that was in Numeric).  So, 
this test should not be taken away.   I'm not sure why it should be 
causing the kind of problems you are describing.  But, if so, the fix is 
elsewhere.

-Travis




More information about the NumPy-Discussion mailing list