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, vstinner, wolma
Date 2016-03-10.11:21:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457608870.08.0.000642012161195.issue26506@psf.upfronthosting.co.za>
In-reply-to
Content
> I regulary see Python code using hex(value)[2:]

In fact, it's even worse, I also saw Python 2 code stripping trailing "L", since hex(long) adds a L suffix...

$ python2
Python 2.7.10 (default, Sep  8 2015, 17:20:17) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
>>> hex(123L)
'0x7bL'
>>> "%x" % 123L
'7b'
>>> format(123L, "x")
'7b'
>>> "%#x" % 123L
'0x7b'
>>> format(123L, "#x")
'0x7b'
History
Date User Action Args
2016-03-10 11:21:10vstinnersetrecipients: + vstinner, eric.smith, docs@python, wolma
2016-03-10 11:21:10vstinnersetmessageid: <1457608870.08.0.000642012161195.issue26506@psf.upfronthosting.co.za>
2016-03-10 11:21:10vstinnerlinkissue26506 messages
2016-03-10 11:21:09vstinnercreate