On 2/15/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > Jason Orendorff wrote: > > Also the pseudo-encodings ('hex', 'rot13', > > 'zip', 'uu', etc.) generally scare me. > > Those are not pseudo-encodings, they are regular codecs. > > It's a common misunderstanding that codecs are only seen as serving > the purpose of converting between Unicode and strings. > > The codec system is deliberately designed to be general enough > to also work with many other types, e.g. it is easily possible to > write a codec that convert between the hex literal sequence you > have above to a list of ordinals:
It's fine that the codec system supports this. However it's questionable that these encodings are invoked using the standard encode() and decode() APIs; and it will be more questionable once encode() returns a bytes object. Methods that return different types depending on the value of an argument are generally a bad idea. (Hence the movement to have separate opentext and openbinary or openbytes functions.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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