Re: Negative block sizes with file-like objects

2008-09-27 Thread Peter Otten
Steven D'Aprano wrote: > I have a proxy class that wraps an arbitrary file-like object fp and > reads blocks of data from it. Is it safe to assume that fp.read(-1) will > read until EOF? I know that's true for file.read() and StringIO.read(), > but is it a reasonable assumption to make for arbitra

Negative block sizes with file-like objects

2008-09-27 Thread Steven D'Aprano
I have a proxy class that wraps an arbitrary file-like object fp and reads blocks of data from it. Is it safe to assume that fp.read(-1) will read until EOF? I know that's true for file.read() and StringIO.read(), but is it a reasonable assumption to make for arbitrary file-like objects? To put