peps: PEP 8 section on string quotes by Akira Li.
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
https://hg.python.org/peps/rev/d3d6128fa91e changeset: 5628:d3d6128fa91e user: Guido van Rossum <guido@python.org> date: Sat Nov 29 19:01:24 2014 -0800 summary: PEP 8 section on string quotes by Akira Li. files: pep-0008.txt | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/pep-0008.txt b/pep-0008.txt --- a/pep-0008.txt +++ b/pep-0008.txt @@ -390,6 +390,19 @@ public and internal interfaces still apply. +String Quotes +============= + +In Python, single-quoted strings and double-quoted strings are the +same. This PEP do not make a recommendation for this. Pick a rule +and stick to it. When a string contains single or double quote +characters, however, use the other one to avoid backslashes in the +string. It improves readability. + +For triple-quoted strings, always use double quote characters to be +consistent with the docstring convention in PEP 257. + + Whitespace in Expressions and Statements ======================================== -- Repository URL: https://hg.python.org/peps
participants (1)
-
guido.van.rossum