PEP 8 section on string quotes by Akira Li.

This commit is contained in:
Guido van Rossum 2014-11-29 19:01:24 -08:00
parent 5f0c213e23
commit a4e187da6b
1 changed files with 13 additions and 0 deletions

View File

@ -390,6 +390,19 @@ Imports
public and internal interfaces still apply. 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 Whitespace in Expressions and Statements
======================================== ========================================