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 rhettinger
Recipients afoglia, pitrou, rhettinger
Date 2009-12-06.01:15:42
SpamBayes Score 0.000117279
Marked as misclassified No
Message-id <1260062145.24.0.341181789585.issue7434@psf.upfronthosting.co.za>
In-reply-to
Content
We need a more generic solution that allows multi-line reprs for a
variety of types.  Here is an example that doesn't involve named tuples:

>>> pprint(s, width=15)
[OrderedDict([('x', 30000000000), ('y', 4000000000), ('z', 5000000000)]),
 OrderedDict([('x', 6000000000), ('y', 70000000), ('z', 8000000000)])]

What we want is to have it print like regular dictionaries do:

>>> pprint([dict(p) for p in s], width=15)
[{'x': 30000000000,
  'y': 4000000000,
  'z': 5000000000},
 {'x': 6000000000,
  'y': 70000000,
  'z': 8000000000}]

It would also be nice if pprint could accept arguments telling it how to
format various types:

>>> pprint(s, width=15, format={int: '15,'})
[{'x': ' 30,000,000,000',
  'y': '  4,000,000,000',
  'z': '  5,000,000,000'},
 {'x': '  6,000,000,000',
  'y': '     70,000,000',
  'z': '  8,000,000,000'}]
History
Date User Action Args
2009-12-06 01:15:46rhettingersetrecipients: + rhettinger, pitrou, afoglia
2009-12-06 01:15:45rhettingersetmessageid: <1260062145.24.0.341181789585.issue7434@psf.upfronthosting.co.za>
2009-12-06 01:15:43rhettingerlinkissue7434 messages
2009-12-06 01:15:43rhettingercreate