[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!
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
> > 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
> 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
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
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
> 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