PEP 8: Fix indentation of two paragraphs in list (#2041)

This commit is contained in:
Veronica Berglyd Olsen 2021-07-22 16:18:38 +02:00 committed by GitHub
parent beb22ee65a
commit 76b7cbd1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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::