New submission from Antoine Pitrou:

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)

----------
components: Library (Lib)
messages: 181599
nosy: fdrake, pitrou
priority: normal
severity: normal
status: open
title: pprint could use line continuation for long string literals
type: enhancement
versions: Python 3.4

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

Reply via email to