[Python-Dev] Simplify the file-like-object interface

Calvin Spealman ironfroggy at gmail.com
Tue Sep 13 14:51:20 CEST 2005


On 9/13/05, Andrew Durdin <adurdin at gmail.com> wrote:
> On 9/6/05, Antoine Pitrou <solipsis at pitrou.net> wrote:
> >
> > One could use "class decorators". For example if you want to define the
> > method foo() in a file-like class, you could use code like:
> 
> I like the sound of this. Suppose there were a function textstream()
> that decorated a file-like object (supporting read() and write()), so
> as to add all of __iter__(), next(), readline(), readlines(), and
> writeline() that it did not already implement. Then you could wrap any
> file-like object easily to give it convenient text-handling:

Yes, this isn't perl and text, although still important, is not worth
its wait in gold these days. And, have you even tried to weigh digital
content to begin with? Not much there anyway.


More information about the Python-Dev mailing list