[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    [Python-Dev] "streams" vs "buffers"
From:       Antoine Pitrou <solipsis () pitrou ! net>
Date:       2011-05-24 10:06:01
Message-ID: 20110524120601.32de673a () pitrou ! net
[Download RAW message or body]

On Tue, 24 May 2011 10:03:22 +0200
"M.-A. Lemburg" <mal@egenix.com> 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
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic