[Python-3000] On PEP 3116: new I/O base classes

James Y Knight foom at fuhm.net
Wed Jun 20 06:19:26 CEST 2007


On Jun 19, 2007, at 2:47 PM, Bill Janssen wrote:

> TextIOBase: this seems an odd mix of high-level and low-level.  I'd
> remove "seek", "tell", "read", and "write".  Remember that in Python,
> mixins actually work, so that you can provide a file object that
> combines several different I/O classes.

Huh? All those operations you want to remove are entirely necessary  
for a number of applications. I'm not sure what you meant about mixins?

> And The Java-ish notion in
> TextIOBase.read(), that you can specify a count for the number of
> characters (or is that the number of UTF-8 bytes, etc... -- rich
> source of subtle bugs), just doesn't work in practice.

It doesn't work? Why not? Of course read() should take the number of  
characters as a parameter, not number of bytes.

> And the
> "codecs" module already provides a way of doing this, for those who
> feel the need.  Stick to just "readline" and "writeline" for text I/O.

Ah, not everyone dealing with text is dealing with line-delimited  
text, you know...

James


More information about the Python-3000 mailing list