PEP 8: Fix indentation of two paragraphs in list (#2041)
This commit is contained in:
parent
beb22ee65a
commit
76b7cbd1a6
12
pep-0008.txt
12
pep-0008.txt
|
@ -1357,15 +1357,15 @@ Programming Recommendations
|
||||||
# Wrong:
|
# Wrong:
|
||||||
if type(obj) is type(1):
|
if type(obj) is type(1):
|
||||||
|
|
||||||
When checking if an object is a string, keep in mind that it might
|
When checking if an object is a string, keep in mind that it might
|
||||||
be a unicode string too! In Python 2, str and unicode have a
|
be a unicode string too! In Python 2, str and unicode have a
|
||||||
common base class, basestring, so you can do::
|
common base class, basestring, so you can do::
|
||||||
|
|
||||||
if isinstance(obj, basestring):
|
if isinstance(obj, basestring):
|
||||||
|
|
||||||
Note that in Python 3, ``unicode`` and ``basestring`` no longer exist
|
Note that in Python 3, ``unicode`` and ``basestring`` no longer exist
|
||||||
(there is only ``str``) and a bytes object is no longer a kind of
|
(there is only ``str``) and a bytes object is no longer a kind of
|
||||||
string (it is a sequence of integers instead).
|
string (it is a sequence of integers instead).
|
||||||
|
|
||||||
- For sequences, (strings, lists, tuples), use the fact that empty
|
- For sequences, (strings, lists, tuples), use the fact that empty
|
||||||
sequences are false::
|
sequences are false::
|
||||||
|
|
Loading…
Reference in New Issue