[SciPy-user] fromfile, item, what other output than stdout / stderr is used ?

Pauli Virtanen pav@iki...
Mon May 11 15:24:15 CDT 2009

Mon, 11 May 2009 15:07:25 -0500, Robert Kern wrote:
> On Mon, May 11, 2009 at 14:57, Christopher Barker
>> The other question is what gets returned, I'm pretty sure that when you
>> call fromfile() with a count, it pre-allocates the array, then fills
>> it, so if you don't have enough items in your file, you'll get an array
>> that is the size you expect, but with partially junk in it -- another
>> way to ask for bugs.
> Currently, it just returns you an array sized for the bytes it could
> read; no junk. It's really easy to try it out instead of guessing.

Not completely true: if it can't read any items, it either raises 
MemoryError. Also, for sep != '' it returns read_count+1 items, the last 
one containing junk. A bug, methinks...

Pauli Virtanen

More information about the SciPy-user mailing list