
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2013-02-07 12:51 bypitrou, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| str_pprint.patch | pitrou,2013-03-19 22:41 | review | ||
| str_pprint2.patch | pitrou,2013-03-20 21:57 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg181599 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-02-07 12:51 | |
Currently:>>> pprint.pprint({"a": "xxx " * 50}){'a': 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx '}It would be nicer if it produced something like:>>> pprint.pprint({"a": "xxx " * 50}){'a': 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx ' 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx ' 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx ' 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx ' 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx '}(for the record, the real-world use case I encountered was when printing some pyudev data) | |||
| msg181605 -(view) | Author: Fred Drake (fdrake)![]() | Date: 2013-02-07 13:25 | |
I like this.It would be especially nice if it were smart enough to split the segments after sequences of line-ends (r'(\r?\n)+'). | |||
| msg181643 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-02-07 19:49 | |
I was thinking we could re-use textwrap, actually. | |||
| msg184695 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-03-19 22:41 | |
Here is a patch. | |||
| msg184808 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-03-20 21:57 | |
Here is a new patch with more tests and updated docs. | |||
| msg185076 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2013-03-23 19:35 | |
New changeset5a2296093645 by Antoine Pitrou in branch 'default':Issue#17150: pprint now uses line continuations to wrap long string literals.http://hg.python.org/cpython/rev/5a2296093645 | |||
| msg185077 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2013-03-23 19:37 | |
Ok, I've committed the patch. | |||
| msg185141 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2013-03-24 15:55 | |
This is a nice addition. Thank you. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:41 | admin | set | github: 61352 |
| 2013-03-24 15:55:00 | rhettinger | set | nosy: +rhettinger messages: +msg185141 |
| 2013-03-23 19:37:04 | pitrou | set | status: open -> closed resolution: fixed messages: +msg185077 stage: patch review -> resolved |
| 2013-03-23 19:35:01 | python-dev | set | nosy: +python-dev messages: +msg185076 |
| 2013-03-20 21:57:41 | pitrou | set | files: +str_pprint2.patch messages: +msg184808 |
| 2013-03-19 22:41:19 | pitrou | set | files: +str_pprint.patch keywords: +patch messages: +msg184695 stage: patch review |
| 2013-02-07 19:49:37 | pitrou | set | messages: +msg181643 |
| 2013-02-07 13:25:25 | fdrake | set | messages: +msg181605 |
| 2013-02-07 12:51:07 | pitrou | create | |