Re: [Python-Dev] empty string api for files

2005-08-28 Thread François Pinard
[Steve Holden] > Terry Reedy wrote: > > This was once a standard paradigm for IBM mainframe files. I > > vaguely remember having to specify the block/record size when > > opening such files. I have no idea of today's practice though. > Indeed. Something like: > SYSIN DD *,BLKSIZE=80 Oh!

Re: [Python-Dev] empty string api for files

2005-08-28 Thread Steve Holden
Terry Reedy wrote: >>I'm not convinced. Where would you ever care about reading a file in >>N-bytes chucks? > > > This was once a standard paradigm for IBM mainframe files. I vaguely > remember having to specify the block/record size when opening such files. > I have no idea of today's practic

Re: [Python-Dev] empty string api for files

2005-08-28 Thread Raymond Hettinger
> > I'm not convinced. Where would you ever care about reading a file in > > N-bytes chucks? > > This was once a standard paradigm for IBM mainframe files. I vaguely > remember having to specify the block/record size when opening such files. > I have no idea of today's practice though. I believe

Re: [Python-Dev] empty string api for files

2005-08-28 Thread Terry Reedy
> I'm not convinced. Where would you ever care about reading a file in > N-bytes chucks? This was once a standard paradigm for IBM mainframe files. I vaguely remember having to specify the block/record size when opening such files. I have no idea of today's practice though. Terry J. Reedy

Re: [Python-Dev] empty string api for files

2005-08-27 Thread Guido van Rossum
On 8/27/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > For reading bytes, I *know* that a lot of code would become uglier if > > the API changed to raise EOFError exceptions > > I had StopIteration in mind. Instead of writing: > > while 1: > block = f.read(20) > if line

Re: [Python-Dev] empty string api for files

2005-08-27 Thread Scott David Daniels
Raymond Hettinger wrote: > We would use: > for block in f.readblocks(20): > . . . What would be nice is a reader that allows a range of bytes. Often when you read a chunk, you don't care about the exact size you get, example uses include the re-blocking that makes reading from compress

[Python-Dev] empty string api for files

2005-08-27 Thread Raymond Hettinger
> For reading bytes, I *know* that a lot of code would become uglier if > the API changed to raise EOFError exceptions I had StopIteration in mind. Instead of writing: while 1: block = f.read(20) if line == '': break . . . We would use: for block in