[Python-Dev] Unicode input issues

Guido van Rossum guido@python.org
Mon, 10 Apr 2000 11:56:26 -0400


> > Aha!  It actually seems that your read() and readline() are
> > inconsistent!
> 
> They are because I haven't yet found a way to implement
> readline() without buffering read-ahead data. The only way
> I can think of to implement it without buffering would be
> to read one char at a time which is much too slow.
>  
> Buffering is hard to implement right when assuming that
> streams are stacked... every level would have its own
> buffering scheme and mixing .read() and .readline()
> wouldn't work too well. Anyway, I'll give it try...

Since you're calling methods on the underlying file object anyway,
can't you avoid buffering by calling the *corresponding* underlying
method and doing the conversion on that?

--Guido van Rossum (home page: http://www.python.org/~guido/)