[Python-Dev] unifying read method semantics

Martin v. Loewis martin@v.loewis.de
21 Jun 2002 10:46:52 +0200


Piers Lauder <piers@cs.su.oz.au> writes:

> And while I'm on the topic - please could we always support "readline"
> (or "makefile") methods in C modules?  

I don't think this is feasiable.

> Surely the following code now
> necessary in imaplib must make CPU-time conscious programmers wince:
> 
>     def readline(self):
>         """Read line from remote."""
>         line = ""
>         while 1:
>             char = self.sslobj.read(1)
>             line += char
>             if char == "\n": return line

Moving this algorithm to another location won't essentially change CPU
consumption...

Regards,
Martin