This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mgiuca
Recipients loewis, mgiuca
Date 2008-08-09.18:25:14
SpamBayes Score 1.16744e-07
Marked as misclassified No
Message-id <>
> I recommend to use binascii.hexlify.

Ah, see I did not know about this! Thanks for pointing it out.

* However, it is *very* obscure. I've been using Python for a year and I
didn't know about it.
* And, it requires importing binascii.
* And, it results in a bytes object, not a str. That's weird. (Perhaps
it would be good idea to change the functions in the binascii module to
output strings instead of bytes? Ostensibly it looks like this module
hasn't undergone py3kification).

Would it hurt to have the tohex method of the bytes object to perform
this task as well? It would be much nicer to use since it's a method of
the object rather than having to find out about and import and use some

Also why have a bytes.fromhex method when you could use binascii.unhexlify?

(If it's better from a code standpoint, you could replace the code I
wrote with a call to binascii.unhexlify).
Date User Action Args
2008-08-09 18:26:19mgiucasetrecipients: + mgiuca, loewis
2008-08-09 18:26:19mgiucasetmessageid: <>
2008-08-09 18:25:15mgiucalinkissue3532 messages
2008-08-09 18:25:14mgiucacreate