Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

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!

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34798>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to