]> granicus.if.org Git - python/commitdiff
Clarify the dedent() example a bit by indenting the input lines unevenly.
authorGreg Ward <gward@python.net>
Thu, 8 May 2003 02:12:35 +0000 (02:12 +0000)
committerGreg Ward <gward@python.net>
Thu, 8 May 2003 02:12:35 +0000 (02:12 +0000)
Doc/lib/libtextwrap.tex
Lib/textwrap.py

index fa0b1fcb2d919695ee3e7c52d5237bd938e5491e..778b57081ceed686d8ff756637285da73c933c0a 100644 (file)
@@ -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}
 
index 754b037323ea78ef5efd32a6b594dce841dd9fd6..f878e52d19bf06368295d44e6a8b2702f6e930d7 100644 (file)
@@ -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