[Numpy-discussion] Simplifying array()

Timo Korvola tkorvola at welho.com
Fri Jan 14 02:08:20 EST 2005


"Colin J. Williams" <cjw at sympatico.ca> writes:
> Yes, I'm not sure whether list comprehension produces an iter object
> but this should also be included.

Lists are iterable but they also have a length, which is not
accessible through the iterator: from a general iterator there is no
way of knowing in advance how many items it will return.  This may be
a problem if you want to allocate memory for the values.

-- 
	Timo Korvola		<URL:http://www.iki.fi/tkorvola>




More information about the NumPy-Discussion mailing list