Hu Luc,On Apr 5, 2013, at 6:46 AM, Luc Bourhis wrote:However, we haven't address the important question: what behaviour do we really want?
(i) the numpy array and the flex array must have the same element type, and an exception is thrown if this precondition is violated;
(ii) we use a fast copy of the numpy array to the flex array if the element types are the same; otherwise we fall back to a slower conversion.My understanding of the "python way" would be that the desired behavior is (ii). [...]
Taking the "pythonic" approach only requiresFor each of the element types that could comprise flex arrays, one only needs to write one PyArray_Descrwhich becomes the second argument for PyArray_CastToType.