-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pprint, single/multiple items per line parameter #52475
Comments
I've run into a case where pprint isn't really pretty. import pprint
pprint.PrettyPrinter().pprint([1]*100) Prints a lengthy column of '1'; Not pretty at all. Look: [1, |
Quick, dirty and utterly incorrect patch that works for me. Includes issue_5131.patch (defaultdict support, etc). Targets trunk (2.6), revision 77310. |
Please generate patches with "context diff", or better "unified diff", with the "diff -u" command. Note that the new version does not respect the width: |
Yes. This patch is nowhere near the production level. Unfortunately it works for me. And in the moment I don't have time to improve it further. Current version doesn't check the item's width upfront, there is definitely room for improvement. There is also an issue with the included issue_5131.patch - pretty-printed code can not be executed, unless 'defaultdict(' ')' type-specs are removed. |
Am rejecting this request because it complicates pprint and makes it harder to extend. Most use cases of pprint either don't need this or have output requirements more complicated than proposed (i.e. adding fixed width columns for tabular output, etc). Also, the current design of pprint doesn't know in advance the width of objects, so a decision to start with multi-column may be invalidated when wider data is encountered later. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: