[Python-3000] iostack and Oh Oh
Guido van Rossum
guido at python.org
Fri Nov 24 23:55:31 CET 2006
On 11/24/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> tomer filiba wrote:
>
> > back in the day, we said all stream objects would support read() and
> > write(), and streams with limited functionality (readonly, writeonly) would
> > be "queriable" using the following properties:
> > * writable
> > * readable
> > * seekable
>
> Is that really necessary? I can't remember ever writing
> code that didn't already know what kind of stream it
> was expecting.
Agreed that for the distinction between readable/writable it's pretty
silly, and probably just encourages LBYL code ("if not f.readable:
raise IOError;; f.read(...)" :-). But I've written plenty of code that
could make good use of seekability but was able to do without it if
necessary, and I suspect I'm not the only one.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list