Summarizing the rationale to use 'abc' as string syntax:

* PEP 8 https://peps.python.org/pep-0008/#string-quotes
  says "In Python, single-quoted strings and double-quoted strings are
  the same. This PEP does not make a recommendation for this. Pick a rule
  and stick to it."

* When I search where the literal string 'foo' occurs, I don't want to make 2
  searches (for 'foo' and for "foo"), nor a regex search (for ['"]foo['"]).
  Simple things should remain simple. A certain canonical way to denote
  literal strings is necessary for this. (Btw, JavaScript has the same
  problem.)

* The Python interpreter prints strings with single-quotes:

  >>> "abc"
  'abc'

So, that makes the single-quotes the natural choice.

Bruno




Reply via email to