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 eric.smith
Recipients docs@python, eric.smith, vstinner
Date 2016-03-07.18:58:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457377139.51.0.983983760887.issue26506@psf.upfronthosting.co.za>
In-reply-to
Content
For 3.5 and 2.7, I'd suggest:
format(value, 'x')
or:
format(value, 'X')

Although you might disagree because of the verbosity. But at least you're not parsing a string at runtime. 

And for 3.6 with PEP-498:
f'{value:x}'

There are of course options for padding and adding the '0x', as well.
History
Date User Action Args
2016-03-07 18:58:59eric.smithsetrecipients: + eric.smith, vstinner, docs@python
2016-03-07 18:58:59eric.smithsetmessageid: <1457377139.51.0.983983760887.issue26506@psf.upfronthosting.co.za>
2016-03-07 18:58:59eric.smithlinkissue26506 messages
2016-03-07 18:58:59eric.smithcreate