On Tue, 24 May 2011 10:03:22 +0200
"M.-A. Lemburg" <[email protected]> wrote:
> 
> StreamReader and StreamWriters are implemented by the codecs,
> they are part of the API that each codec has to provide in order
> to register in the Python codecs system. Their purpose is
> to provide a stateful interface and work efficiently and
> directly on streams rather than buffers.

I think you are trying to make a conceptual distinction which doesn't
exist in practice. Your OS uses buffers to represent "streams" to you.

Also, how come StreamReader has internal members named "bytebuffer",
"charbuffer" and "linebuffer"?
There certainly seems to be some (non-trivial) amount of buffering
going on there, and probably quite slow and inefficient since it's pure
Python (TextIOWrapper is written in C).

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to