On 6/14/2016 12:29 PM, Mark Lawrence via Python-Dev wrote:

As I've the time to play detective I'd suggest
https://mail.python.org/pipermail/python-3000/2007-July/008975.html

Thank you for finding that. I reread it and still believe that bytes was the right choice. Base64 is an generic edge encoding for binary data. It fits in with the the standard paradigm as a edge encoding.

Receive encoded bytes.
Decode bytes to python objects
Manipulate python objects
Encode python objects to bytes
Send bytes.

Receive and send can be from and to either local files or sockets usually connected to remote systems. Transmissions can have blocks with different encodings. In the latter case, the bytes need to be parsed into blocks with different encodings.

In the (fairly common) special case that a transmission consists entirely of text in *1* encoding (ignoring any transmission wrappers), decode and encode can be incorporated into a text-mode file object. If a transmission consists entirely or partly of binary, one can open in binary mode and .write one or more blocks of encoded bytes, possible with encoding data.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to