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 serhiy.storchaka
Recipients docs@python, eric.smith, serhiy.storchaka, vstinner, wolma
Date 2016-03-10.17:47:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457632055.73.0.226285535114.issue26506@psf.upfronthosting.co.za>
In-reply-to
Content
> 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().
History
Date User Action Args
2016-03-10 17:47:35serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, eric.smith, docs@python, wolma
2016-03-10 17:47:35serhiy.storchakasetmessageid: <1457632055.73.0.226285535114.issue26506@psf.upfronthosting.co.za>
2016-03-10 17:47:35serhiy.storchakalinkissue26506 messages
2016-03-10 17:47:35serhiy.storchakacreate