[issue19132] Add compact mode to pprint
Roundup Robot added the comment: New changeset 60301b9982b2 by Terry Jan Reedy in branch '2.7': Issue #21597: Turtledemo text pane can now be widened to view or copy complete http://hg.python.org/cpython/rev/60301b9982b2 New changeset 0fb515063324 by Terry Jan Reedy in branch '3.4': Issue #21597: Turtledemo text pane can now be widened to view or copy complete http://hg.python.org/cpython/rev/0fb515063324 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Roundup Robot added the comment: New changeset ae0306c8f7a3 by Serhiy Storchaka in branch 'default': Issue #19132: The pprint module now supports compact mode. http://hg.python.org/cpython/rev/ae0306c8f7a3 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
R. David Murray added the comment: Sorry I missed this on the review, but you are missing versionchanged tags (or versionadded, whichever you prefer :) and a what's new entry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Serhiy Storchaka added the comment: I had added a what's new entry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Roundup Robot added the comment: New changeset 6e7b1aadea2f by Serhiy Storchaka in branch 'default': Issue #19132: Add versionchanged tags. http://hg.python.org/cpython/rev/6e7b1aadea2f -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Antoine Pitrou added the comment: As noted in the review, I'm not as keen on having dictionaries displayed in compact form. Agreed with David. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Serhiy Storchaka added the comment: Updated patch doesn't compactify dicts. -- Added file: http://bugs.python.org/file31935/pprint_compact_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
R. David Murray added the comment: I like it. If it isn't too difficult, I'd suggest that compact mode also indent the string continuation lines: ['one string', 'other string', 'very very long string which is continued on ' 'several lines', 'and again', 'and again', 'and again', 'and again'] -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Serhiy Storchaka added the comment: Here is a patch. Please review and correct the documentation. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file31924/pprint_compact.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Serhiy Storchaka added the comment: I'd suggest that compact mode also indent the string continuation lines: Please open new issue for this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
R. David Murray added the comment: As noted in the review, I'm not as keen on having dictionaries displayed in compact form. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Serhiy Storchaka added the comment: Updated patch addresses David's comments. Thank you David. As noted in the review, I'm not as keen on having dictionaries displayed in compact form. This makes sense. If no one will argue for compactifying mappings I'll remove this part of the patch. -- Added file: http://bugs.python.org/file31925/pprint_compact_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
New submission from Serhiy Storchaka: pprint produces not very nice output for collections with a large number of short elements (see msg198556). For example pprint.pprint(list(range(40))) outputs more than 40 short lines, while print(repr(list(range(40 takes only 2 lines on 80-column terminal. I propose to add new boolean option compact. With compact=True pprint will try combine as much short one-line subelements in one line as possible. Every multiline element will be printed on separated lines. Examples: pprint.pprint(list(range(40)), width=50, compact=True) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] pprint.pprint(['one string', 'other string', 'very very long string which continued on several lines', 'and again', 'and again', 'and again', 'and again'], width=50, compact=True) ['one string', 'other string', 'very very long string which is continued on ' 'several lines', 'and again', 'and again', 'and again', 'and again'] -- components: Library (Lib) messages: 198641 nosy: serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Add compact mode to pprint type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19132] Add compact mode to pprint
Antoine Pitrou added the comment: I think it looks good on the principle. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com