Strings: double versus single quotes

Skip Montanaro skip.montanaro at gmail.com
Sat May 23 16:39:11 EDT 2020


>
>
> May I ask why not simply like this:
>
> stmt = """
>       select foo from bar
>         where a = 'bag'
>           and c = 'dog'
>       """
>

Sorry, I don't recall. I wouldn't be at all surprised that it has something
to do with Emacs's Python mode behavior. Emacs wouldn't know what to do
with spaces in the string, but knows where to put string literals within
the open parens. I'm pretty sure I was doing this before triple quoted
strings existed.

Thankfully, I don't need to mess around with SQL anymore. :-)

Skip

>


More information about the Python-list mailing list