I agree with Chris Lasher's basic point, that the representation of bytes confusingly contradicts the idea that bytes are bytes. But it is not going to change.
On 9/10/2014 3:56 AM, Cory Benfield wrote:
On 10 September 2014 08:45, Nick Coghlan ncoghlan@gmail.com wrote:
memoryview.cast can be a potentially useful tool for that :)
Sure, and so can binascii.hexlify (which is what I normally use).
See http://bugs.python.org/issue9951 to add bytes.hex or .tohex as more of less the inverse of bytes.fromhex or even have hex(bytes) work. This change *is* possible and I think we should pick one of the suggestions for 3.5.