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 markhirota
Recipients
Date 2005-11-08.21:29:22
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
It would be nice to have some sort of switch or hook to 
allow 'pretty-printing' of integers and long integers in 
hexidecimal. So, for example:

>>> import pprint
>>> pprint.pprint(range(10)) # instead of this:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> pprint.hexint = True
>>> pprint.pprint(range(10)) # you would get this:
[0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9]
>>> pprint.pprint(range(0x100000000,0x100000010)) # 
and this:
[0x100000000L,
 0x100000001L,
 0x100000002L,
 0x100000003L,
 0x100000004L,
 0x100000005L,
 0x100000006L,
 0x100000007L,
 0x100000008L,
 0x100000009L,
 0x10000000AL,
 0x10000000BL,
 0x10000000CL,
 0x10000000DL,
 0x10000000EL,
 0x10000000FL]
>>>

Thanks,
--MH
History
Date User Action Args
2007-08-23 16:11:29adminlinkissue1351692 messages
2007-08-23 16:11:29admincreate