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 xtreak
Recipients Nicolas Hug, xtreak
Date 2018-09-25.17:38:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537897110.45.0.545547206417.issue34798@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the report Nicolas. I looked into the code and it seems that pprint for a dictionary now doesn't really take compact into account. List, sets, tuple and dequeue use _format_items [0] that honors value of compact but dictionary formatting uses _format_dict_items [1] that doesn't without using compact value. Unfortunately, I don't have any links over why dictionary doesn't take compact into account. I would suggest python-ideas [3] to get more feedback about formatting and implementation along with backwards compatibility so that you can proceed further. Your suggestion seems reasonable to me but I don't know if some program is using compact=True for a dictionary without knowing the internals in mind that might break for them. I would wait for others thoughts on this and I think this can be done only on 3.8 and not 3.7 which is in bug fix mode.

[0] https://github.com/python/cpython/blob/fdcb5ae25c0b5c82a32955617d253810ef110cac/Lib/pprint.py#L350
[1] https://github.com/python/cpython/blob/fdcb5ae25c0b5c82a32955617d253810ef110cac/Lib/pprint.py#L333
[2] https://mail.python.org/pipermail/python-ideas/

Hope this helps!
History
Date User Action Args
2018-09-25 17:38:30xtreaksetrecipients: + xtreak, Nicolas Hug
2018-09-25 17:38:30xtreaksetmessageid: <1537897110.45.0.545547206417.issue34798@psf.upfronthosting.co.za>
2018-09-25 17:38:30xtreaklinkissue34798 messages
2018-09-25 17:38:30xtreakcreate