Bill Janssen wrote:
> Will this work properly in Python 3K? I tend to use base64, for
> example, to turn byte sequences into safe strings, so I need a way of
> doing "encode" on byte sequences, not just strings.
>
> In general, base64.encode() should operate on byte sequences and
> return strings, and decode() should operate on strings and return byte
> sequences.
Yes. Not all encoders are unicode->str, and not all decoders are str->unicode.
This is a point which is often forgotten. Having different functions for
encoders ("foo".encode.base64()) like someone was proposing in this thread
would also make it slightly less confusing.
--
Giovanni Bajo
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com