Message261518
> That's why I ran the micro-benchmark and, in fact, I was expecting %-interpolation to be faster exactly because it is less flexible.
Actually %-interpolation is more flexible.
>>> '%x' % 123
'7b'
>>> '%0X' % 123
'7B'
>>> '%#x' % 123
'0x7b'
>>> '%04x' % 123
'007b'
If document alternatives for hex(), we should also document formatting alternatives for bin(), oct(), repr(), ascii(), str(), chr(), str.ljust(), str.rjust(), str.center(), str.zfill(). |
|
Date |
User |
Action |
Args |
2016-03-10 17:47:35 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vstinner, eric.smith, docs@python, wolma |
2016-03-10 17:47:35 | serhiy.storchaka | set | messageid: <1457632055.73.0.226285535114.issue26506@psf.upfronthosting.co.za> |
2016-03-10 17:47:35 | serhiy.storchaka | link | issue26506 messages |
2016-03-10 17:47:35 | serhiy.storchaka | create | |
|