Message239234
Currently pprint prints the repr of OrderedDict if it fits in one line, and prints the repr of dict if it is wrapped.
>>> import collections, pprint
>>> pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)]))
OrderedDict([(4, 3), (2, 1)])
>>> pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)]), width=25)
{4: 3,
2: 1}
Proposed patch makes pprint always produce an output compatible with OrderedDict's repr.
>>> pprint.pprint(collections.OrderedDict([(4, 3), (2, 1)]), width=25)
OrderedDict([(4, 3),
(2, 1)]) |
|
Date |
User |
Action |
Args |
2015-03-25 07:54:56 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, fdrake, rhettinger |
2015-03-25 07:54:56 | serhiy.storchaka | set | messageid: <1427270096.56.0.104555413271.issue23775@psf.upfronthosting.co.za> |
2015-03-25 07:54:56 | serhiy.storchaka | link | issue23775 messages |
2015-03-25 07:54:56 | serhiy.storchaka | create | |
|