Re:Why Python 3 Exists
by mark-r on Thursday December 17, 2015 @06:40PM
(#10755537)
I agree that encode() and decode() are ambiguous, I find myself pausing to make sure I'm using the right one.
You can use bytes(string,encoding) to replace encode(). Unfortunately it doesn't have a default encoding, which makes it a pain to use. And str(bstring) isn't symmetric, it can't replace decode().
You can use bytes(string,encoding) to replace encode(). Unfortunately it doesn't have a default encoding, which makes it a pain to use. And str(bstring) isn't symmetric, it can't replace decode().