[Python-Dev] why doesn't print pass unicode strings on to the file object?

Fredrik Lundh fredrik@pythonware.com
Tue, 18 Sep 2001 12:22:03 +0200


martin wrote:

> I guess not. If the codec.lookup return value is changed, then I can
> write
>
> encoder = codecs.lookup("latin-1").encode
>
> Without that, I have to write
>
> encoder = codecs.CodecInfo(codecs.lookup("latin-1")).encode

or you could make things more readable, and add explicit
get-functions for each property:

    encoder = codecs.getencoder("latin-1")

much easier to understand, especially for casual users
(cf. os.path.getsize etc)

</F>