title: pprint with hex numbers
body: <p>I work with a number of json-like dicts. <code>pprint</code> is handy for structuring them. Is there a way to cause all ints in a pprint output to be printed in hex rather than decimal?</p>
  
  <p>For example, rather than:</p>
  
  <pre><code>{66: 'far',
   99: 'Bottles of the beer on the wall',
   '12': 4277009102,
   'boo': 21,
   'pprint': [16, 32, 48, 64, 80, 96, 112, 128]}
  </code></pre>
  
  <p>I'd rather see:</p>
  
  <pre><code>{0x42: 'far',
   0x63: 'Bottles of the beer on the wall',
   '12': 0xFEEDFACE,
   'boo': 0x15,
   'pprint': [0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80]}
  </code></pre>
  
  <p>I have tried customizing <code>PrettyPrinter</code>, but to no avail, was I able to cause the above, having <code>PrettyPrinter.format()</code> handle integers only seems to work for some of the integers:</p>
  
  <pre><code>class MyPrettyPrinter(PrettyPrinter):
      def format(self, object, context, maxlevels, level):
          if isinstance(object, int):
              return '0x{:X}'.format(object), True, False
          return super().format(object, context, maxlevels, level)
  </code></pre>
  
  <p>the above class produces</p>
  
  <pre><code>{0x42: 'far',
   0x63: 'Bottles of the beer on the wall',
   '12': 0xFEEDFACE,
   'boo': 0x15,
   'pprint': [16, 32, 48, 64, 80, 96, 112, 128]}
  </code></pre>
  
  <p>The list contents are not correctly formatted.</p>