Message261312
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. |
|
Date |
User |
Action |
Args |
2016-03-07 18:58:59 | eric.smith | set | recipients:
+ eric.smith, vstinner, docs@python |
2016-03-07 18:58:59 | eric.smith | set | messageid: <1457377139.51.0.983983760887.issue26506@psf.upfronthosting.co.za> |
2016-03-07 18:58:59 | eric.smith | link | issue26506 messages |
2016-03-07 18:58:59 | eric.smith | create | |
|