Marc-Andre Lemburg <m...@egenix.com> added the comment:

Antoine Pitrou wrote:
> 
> Antoine Pitrou <pit...@free.fr> added the comment:
> 
>> TextIOWrapper() is conceptually something completely different. It's
>> more something like StreamReaderWriter().
> 
> That's a rather strange assertion. Can you expand?
> TextIOWrapper supports read-only, write-only, read-write, unseekable and
> seekable streams.

StreamReader and StreamWriter classes provide the base codec
implementations for stateful interaction with streams. They
define the interface and provide a working implementation for
those codecs that choose not to implement their own variants.

Each codec can, however, implement variants which are optimized
for the specific encoding or intercept certain stream methods
to add functionality or improve the encoding/decoding
performance.

Both are essential parts of the codec interface.

TextIOWrapper and StreamReaderWriter are merely wrappers
around streams that make use of the codecs. They don't
provide any codec logic themselves. That's the conceptual
difference.

----------
title: Deprecate codecs.open(), codecs.StreamReader and codecs.StreamWriter -> 
Deprecate codecs.open(), codecs.StreamReader and codecs.StreamWriter

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8796>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to