]> granicus.if.org Git - python/commitdiff
Added a note to the section on 'exec' about the need for a trailing newline
authorGreg Ward <gward@python.net>
Thu, 27 Apr 2000 18:32:02 +0000 (18:32 +0000)
committerGreg Ward <gward@python.net>
Thu, 27 Apr 2000 18:32:02 +0000 (18:32 +0000)
in certain circumstances.  (Apparently, this is a CPython problem.)

Doc/ref/ref6.tex

index 6c2b485c0b78333a9334286f2693c442f429835a..b62e394fe66fbcab4eac5f209f806be43082042b 100644 (file)
@@ -227,7 +227,7 @@ target sequence, if the object allows it.
 \indexii{slicing}{assignment}
 
 \end{itemize}
-       
+        
 (In the current implementation, the syntax for targets is taken
 to be the same as for expressions, and invalid syntax is rejected
 during the code generation phase, causing less detailed error
@@ -612,3 +612,12 @@ for use by \keyword{exec}.
 \bifuncindex{eval}
 \bifuncindex{globals}
 \bifuncindex{locals}
+
+Also, in the current implementation, multi-line compound statements must
+end with a newline:
+\code{exec "for v in seq:\e{}n\e{}tprint v\e{}n"} works, but
+\code{exec "for v in seq:\e{}n\e{}tprint v"} fails with
+\exception{SyntaxError}.
+\exindex{SyntaxError}
+  
+