Python doesn't recognize quote types
Nicolas Dandrimont
nicolas.dandrimont at gmail.com
Sat May 10 17:15:07 EDT 2008
* wxPythoner at gmail.com <wxPythoner at gmail.com> [2008-05-10 13:56:39 -0700]:
> 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?
The "single-quoted string" (e.g. 'foo' or "bar") is so named by
opposition to triple-quoted (e.g. '''foo''' or """bar""") strings.
Regards,
--
Nicolas Dandrimont
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20080510/6fab6ed2/attachment-0001.sig>
More information about the Python-list
mailing list