[Python-Dev] Why does base64 return bytes? (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jun 15 03:07:26 EDT 2016


Simon Cross wrote:

If we only support one, I would prefer it to be bytes since (bytes -> bytes -> unicode) seems like less overhead and slightly conceptually clearer than (bytes -> unicode -> bytes),

Whereas bytes -> unicode, followed if needed by unicode -> bytes, seems conceptually clearer to me. IOW, base64 is conceptually a bytes-to-text transformation, and the usual way to represent text in Python 3 is unicode.

-- Greg



More information about the Python-Dev mailing list