PEP 8 section on string quotes by Akira Li.
This commit is contained in:
parent
5f0c213e23
commit
a4e187da6b
13
pep-0008.txt
13
pep-0008.txt
|
@ -390,6 +390,19 @@ Imports
|
|||
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
|
||||
========================================
|
||||
|
||||
|
|
Loading…
Reference in New Issue