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 vstinner
Recipients docs@python, eric.smith, serhiy.storchaka, vstinner, wolma
Date 2016-03-11.08:37:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457685452.46.0.309954772623.issue26506@psf.upfronthosting.co.za>
In-reply-to
Content
I opened the issue when I read this change:
https://review.openstack.org/#/c/288224/2/neutron/common/utils.py

    rndstr = hex(...)[2:]
    # Whether there is a trailing 'L' is a py2/3 incompatibility
    rndstr = rndstr.rstrip('L')
    return rndstr.zfill(length)

can be simply written

    return "{0:0{1}x}".format(..., length)

It's less readable, but it's more efficient.
History
Date User Action Args
2016-03-11 08:37:32vstinnersetrecipients: + vstinner, eric.smith, docs@python, serhiy.storchaka, wolma
2016-03-11 08:37:32vstinnersetmessageid: <1457685452.46.0.309954772623.issue26506@psf.upfronthosting.co.za>
2016-03-11 08:37:32vstinnerlinkissue26506 messages
2016-03-11 08:37:32vstinnercreate