Terry J. Reedy added the comment:

The proposal is to add a .hex method (similar to binascii.hexlify) that is the 
inverse of .fromhex (similar to binascii.unhexlify), as originally specified in 
PEP 358.
http://legacy.python.org/dev/peps/pep-0358/
"The object has a .hex() method that does the reverse [of .frombytes]
   >> bytes([92, 83, 80, 255]).hex()
   '5c5350ff'
"
If we add .hex, I think we should stick with this: no 0x or \x prefix. 

To aid debugging, I would change spaces to be None or a positive int n to 
insert a space every n bytes.  So .hex(8) for an array of 64 bit ints.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9951>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to