Python doesn't recognize quote types

Duncan Booth duncan.booth at invalid.invalid
Sun May 11 07:57:48 EDT 2008


wxPythoner at gmail.com wrote:

> There's a thing that bugs me in Python. Look at this...
> 
>>>> print "Testing\"
> SyntaxError: EOL while scanning single-quoted string
> 
> 
> Please focus on the part of the error message that states "while
> scanning single-quoted string". How can Python claim it scanned a
> single-quoted string when I fed it with a double-quoted string? Is
> quote type (single quote and double quote) recognition not implemented
> in Python?
> 
Of course it is, but that isn't what is meant here.

Python supports single-quoted strings which are delimited by either a 
single quote or a double quote mark. It also supports triple-quoted strings 
which are delimited either by three single quotes or three double quotes.

The overloaded meaning of 'single' is perhaps unfortunate.



More information about the Python-list mailing list