On Thu, Apr 25, 2013 at 8:57 AM, Stephen J. Turnbull <step...@xemacs.org> wrote: > I think that would be an unfortunate result. These operations on > streams are theoretically nicely composable. It would be nice if > practice reflected that by having a uniform API for all of these > operations (charset translation, encoded text to internal, content > transfer encoding, compression ...). I think it would be useful, too, > though I can't prove that.
But the translation to and from Unicode to some 8-bit encoding is different from the others. It makes sense that they have a different API. If you have a Unicode string you can go: Unicode text -> UTF8 -> ZIP -> BASE64. Or you can go Unicode text -> UTF8 -> BASE64 -> ZIP Although admittedly that makes much less sense. :-) But you can not go: Unicode text -> BASE64 -> ZIP -> UTF8 The str/bytes encoding/decoding is not like the others. //Lennart _______________________________________________ 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/archive%40mail-archive.com