[Numpy-discussion] PyArray_FromAny does not accept a generator?

Robert Kern robert.kern@gmail....
Fri Jan 4 14:37:57 CST 2008


Neal Becker wrote:
> It seems that PyArray_FromAny does not accept a generator?
> 
> Seems like this would be useful.

It's difficult to do all the magical interpretation that PyArray_FromAny() does
with a iterator of unknown length. In Python, we have fromiter() which will
consume an iterator to make (only) a rank-1 array and thus sidestep a big chunk
of the magical interpretation.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list