Message226732
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. |
|
Date |
User |
Action |
Args |
2014-09-10 23:29:34 | terry.reedy | set | recipients:
+ terry.reedy, georg.brandl, rhettinger, mark.dickinson, ncoghlan, pitrou, vstinner, gotgenes, christian.heimes, eric.araujo, Arfrever, wiggin15, martin.panter, serhiy.storchaka, hct |
2014-09-10 23:29:34 | terry.reedy | set | messageid: <1410391774.33.0.620860901273.issue9951@psf.upfronthosting.co.za> |
2014-09-10 23:29:34 | terry.reedy | link | issue9951 messages |
2014-09-10 23:29:34 | terry.reedy | create | |
|