Ben Finney wrote:
Another way of thinking about it is that there's no sensible sequence of
bytes to return at EOF, so the Pythonic thing to do is to raise an
exception for this exceptional circumstance.
But this is *not* what Python does, so it's obviously
not Pythonic. :-)
If f.read(n) is to
> Seebs writes:
> > On 2010-10-13, Chris Rebert wrote:
> > > For future reference, the significant majority of things in Python
> > > raise exceptions upon encountering errors rather than returning
> > > error values of some sort.
> >
> > Yes. I'm getting used to that -- it's a bit of a shift,
Seebs writes:
> On 2010-10-13, Chris Rebert wrote:
> > For future reference, the significant majority of things in Python
> > raise exceptions upon encountering errors rather than returning
> > error values of some sort.
>
> Yes. I'm getting used to that -- it's a bit of a shift, because I'm
>