Consider the following typescript:
>>> s = 'a'
>>> isinstance(s, bytes)
True
>>> isinstance(s, str)
True
>>> isinstance(s, unicode)
False
>>> isinstance(s.decode('utf-8'), unicode)
True
How come s
is both a str
and a bytes
? Is one of those a descendant of the other one?
How did I run into it? I was trying to find description of decode
method in the docs. I couldn't find it for str
, but was able for bytes
.