2 ms·
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 enc
by mark-r 11y ago
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().