diff --git a/pep-0008.txt b/pep-0008.txt index 8bf669b9fa0..8b31cd0673a 100644 --- a/pep-0008.txt +++ b/pep-0008.txt @@ -1357,15 +1357,15 @@ Programming Recommendations # Wrong: if type(obj) is type(1): -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 -common base class, basestring, so you can do:: + 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 + common base class, basestring, so you can do:: if isinstance(obj, basestring): -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 -string (it is a sequence of integers instead). + 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 + string (it is a sequence of integers instead). - For sequences, (strings, lists, tuples), use the fact that empty sequences are false::