Pretty printing dicts with compact=True

Nicolas Hug niourf at gmail.com
Tue Sep 11 07:58:48 EDT 2018


Is there a reason why the 'compact' parameter is ignored when pretty 
printing a dict? For example:

pprint({x: x for x in range(15)}, compact=True)

would be be printed in 15 lines while it could fit on 2.


Is this a bug or was this decided on purpose?

Thank you!




More information about the Python-list mailing list