[Python-Dev] Simplify the file-like-object interface (Replacement for print in Python 3.0)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Sep 6 13:22:35 CEST 2005


Fredrik Lundh wrote:

> (you completely missed the point -- today's print mechanism works on *any* object
> that implements a "write" method, no just file objects.  saying that "oh, all you need is
> to add a method" or "here's a nice mixin" doesn't give you a print replacement)

While we're on the subject, in Py3k I'd like to see
readline(), readlines(), etc. removed from file objects
and made builtin functions instead. It should only
be necessary to implement read() and write() to get
a file-like object having equal status with all
others.

Greg


More information about the Python-Dev mailing list