0

Possible Duplicate:
Single quotes vs. double quotes in Python

In Python, what are some drawbacks of enclosing string literals in double quotes when unnecessary?

My understanding has been that when a string literal contains a single quote but no double quote, it needs to be enclosed in double quotes, otherwise it should be enclosed in single quotes, although using double quotes in the latter case won't issue errors.

Could you think of a case where using double quotes when unnecessary actually causes problems?

Community
  • 1
  • 1
qazwsx
  • 25,536
  • 30
  • 72
  • 106

1 Answers1

1

You can use whatever you want, there's nothing in the PEPs. And I don't know of any disadvantages.

I prefer single quotes, though. Saves me a keypress (or rather two, in most cases).

nisc
  • 4,222
  • 4
  • 29
  • 34