New submission from Nick Coghlan <ncogh...@gmail.com>: As far I am aware, the simplest way to indent a multi-line string is with the following snippet:
'\n'.join((4 * ' ') + x for x in s.splitlines()) It would be a lot simpler and clearer if I could just write that as "textwrap.indent(s, 4 * ' ')". (i.e. indent would accept a prefix string to be inserted before each line in the supplied string, as in the original comprehension) ---------- components: Library (Lib) messages: 151932 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add textwrap.indent() as counterpart to textwrap.dedent() type: enhancement versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13857> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com