On 12/16/2019 12:05 AM, Kyle Stanley wrote:
Chris Angelico wrote:
> ANY object can be passed to str() in order to get some sort of valid
> printable form. The awkwardness comes from the fact that str()
> performs double duty - it's both "give me a printable form of this
> object" and "decode these bytes into text".
While it does make sense for str() to be able to give some form of
printable form for any object, I suppose that I just don't consider
something like this: "b'\\xc3\\xa1'" to be overly useful, at least for
any practical purposes. Can anyone think of a situation where you
would want a string representation of a bytes object instead of
decoding it?
Binary data
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/BLYF3OAG6LLVBRJ4J6A6QSGC7KFKBX7I/
Code of Conduct: http://python.org/psf/codeofconduct/