[Python-3000] PEP 3108: Standard Library Reorganization

Bill Janssen bill at janssen.org
Wed Jan 3 18:11:57 CET 2007


> Isn't this a lot more idiomatically translated as
>     'hello world'.encode('base64')
> or is there still too much worry that this will require
> encoding/decoding ascii bytestrings?

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.

Bill


More information about the Python-3000 mailing list