]> granicus.if.org Git - python/commitdiff
Fix whitespace in example of bad indentation: a comment indicated that one
authorFred Drake <fdrake@acm.org>
Tue, 11 Dec 2001 17:46:38 +0000 (17:46 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 11 Dec 2001 17:46:38 +0000 (17:46 +0000)
line was not indented at all, so the example is no longer indented at all.
All of the errors being shown remain.

Typo: characteru --> character

Doc/ref/ref2.tex

index 11dea968d1fbe7b88bc1ec64186271e8281a8c1d..74aaae4b7e5bb9683330763ff9d22cf62cacc445 100644 (file)
@@ -195,13 +195,13 @@ def perm(l):
 The following example shows various indentation errors:
 
 \begin{verbatim}
    def perm(l):                       # error: first line indented
-    for i in range(len(l)):             # error: not indented
-        s = l[:i] + l[i+1:]
-            p = perm(l[:i] + l[i+1:])   # error: unexpected indent
-            for x in p:
-                    r.append(l[i:i+1] + x)
-                return r                # error: inconsistent dedent
+ def perm(l):                       # error: first line indented
+for i in range(len(l)):             # error: not indented
+    s = l[:i] + l[i+1:]
+        p = perm(l[:i] + l[i+1:])   # error: unexpected indent
+        for x in p:
+                r.append(l[i:i+1] + x)
+            return r                # error: inconsistent dedent
 \end{verbatim}
 
 (Actually, the first three errors are detected by the parser; only the
@@ -327,7 +327,7 @@ String literals are described by the following lexical definitions:
   \production{shortstringchar}
              {<any ASCII character except "\e" or newline or the quote>}
   \production{longstringchar}
-             {<any ASCII characteru except "\e">}
+             {<any ASCII character except "\e">}
   \production{escapeseq}
              {"\e" <any ASCII character>}
 \end{productionlist}