Message54668
Logged In: YES
user_id=80475
IMO, such a rewrite would expose too many of pprint's
internals and make the module harder to
use/understand/maintain. Wouldn't it be better to stick
with the usual idiom for controlling the repr() formatting
of specific types by using a class wrapper:
>>> from pprint import pprint
>>> class Int(int):
def __repr__(self):
return hex(self)
>>> pprint([Int(x) for x in range(0x10000000,0x10000010)])
[0x10000000,
0x10000001,
0x10000002,
0x10000003,
0x10000004,
0x10000005,
0x10000006,
0x10000007,
0x10000008,
0x10000009,
0x1000000a,
0x1000000b,
0x1000000c,
0x1000000d,
0x1000000e,
0x1000000f] |
|
Date |
User |
Action |
Args |
2007-08-23 16:11:29 | admin | link | issue1351692 messages |
2007-08-23 16:11:29 | admin | create | |
|