From: Neal Becker on
Isn't this a bug?

print \"

SyntaxError: unexpected character after line continuation character


From: Grant Edwards on
On 2010-06-20, Neal Becker <ndbecker2(a)gmail.com> wrote:
> Isn't this a bug?
>
> print \"
>
> SyntaxError: unexpected character after line continuation character

No.

http://www.google.com/search?q=python+line+continuation+character

First hit:

http://docs.python.org/reference/lexical_analysis.html

Section 2.1.5

Two or more physical lines may be joined into logical lines using
backslash characters (\), as follows: when a physical line ends in a
backslash that is not part of a string literal or comment, [...]
[...]
A backslash is illegal elsewhere on a line outside a string literal.

Anything else we can look up for you?

--
Grant




From: Terry Reedy on
On 6/20/2010 7:22 PM, Neal Becker wrote:
> Isn't this a bug?
>
> print \"
>
> SyntaxError: unexpected character after line continuation character

This is definitely a syntax error. The message is about as good an
interpretation of nonsensical situation as one could expect from an
automaton.

Terry Jan Reedy