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.1674415e-07
Marked as misclassified No
Message-id <1218306379.24.0.287240596762.issue3532@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
function.

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).
History
Date User Action Args
2008-08-09 18:26:19mgiucasetrecipients: + mgiuca, loewis
2008-08-09 18:26:19mgiucasetmessageid: <1218306379.24.0.287240596762.issue3532@psf.upfronthosting.co.za>
2008-08-09 18:25:15mgiucalinkissue3532 messages
2008-08-09 18:25:14mgiucacreate