From: Greg Ward Date: Thu, 8 May 2003 02:12:35 +0000 (+0000) Subject: Clarify the dedent() example a bit by indenting the input lines unevenly. X-Git-Tag: v2.3c1~805 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86e1790cad8bb85faad5e91e1a46dc7c6373d20a;p=python Clarify the dedent() example a bit by indenting the input lines unevenly. --- diff --git a/Doc/lib/libtextwrap.tex b/Doc/lib/libtextwrap.tex index fa0b1fcb2d..778b57081c 100644 --- a/Doc/lib/libtextwrap.tex +++ b/Doc/lib/libtextwrap.tex @@ -59,11 +59,11 @@ For example: def test(): # end first line with \ to avoid the empty line! s = '''\ - Hey - there + hello + world ''' - print repr(s) # prints ' Hey\n there\n ' - print repr(dedent(s)) # prints 'Hey\nthere\n' + print repr(s) # prints ' hello\n world\n ' + print repr(dedent(s)) # prints 'hello\n world\n' \end{verbatim} \end{funcdesc} diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 754b037323..f878e52d19 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -325,11 +325,11 @@ def dedent(text): def test(): # end first line with \ to avoid the empty line! s = '''\ - Hey - there + hello + world ''' - print repr(s) # prints ' Hey\n there\n ' - print repr(dedent(s)) # prints 'Hey\nthere\n' + print repr(s) # prints ' hello\n world\n ' + print repr(dedent(s)) # prints 'hello\n world\n' """ lines = text.expandtabs().split('\n') margin = None