[Python-3000] base64.{decode,encode}string (original) (raw)
Bill Janssen janssen at parc.com
Sat Oct 27 02:24:47 CEST 2007
- Previous message: [Python-3000] base64.{decode,encode}string
- Next message: [Python-3000] passing bytes buffers to C with NUL characters in them?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2007/10/26, Bill Janssen <janssen at parc.com>: > I think encodestring() should return a string, not bytes, and > decodestring() should take either a string, or bytes containing an > ASCII-encoded string. Otherwise, every place they'll ever be > used has to wrap an additional unicode/encode step around their > use.
I'm okay with being flexible on input. I think there ought to be separate functions returning bytes and str.
I'm fine with that, too. I just think that the purpose of standard_b64encode() is to take bytes and produce text, and the purpose of standard_b64decode() is to take text and produce bytes. But if we want to add encodestring_to_ascii(), to take bytes and produce ASCII base64-encoded bytes, and decodestring_from_ascii(), to take an ASCII-encoded string as bytes, and produce bytes, that's OK with me. But it seems odd.
Bill
- Previous message: [Python-3000] base64.{decode,encode}string
- Next message: [Python-3000] passing bytes buffers to C with NUL characters in them?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]