可用type函数来查看类型
>>> "我们".encode("gbk")
b'\xce\xd2\xc3\xc7'
>>> type("我们".encode("gbk")) #转为gbk是bytes类型
<class 'bytes'>
>>> type("我们") #单独的我们是str类型
<class 'str'>
isintance 判断是不是其中的一个类型
定义函数的时候,会判断类型,提升容错性
>>> s="我们"
>>> isinstance(s,(str,bytes))
True
>>> isinstance("我们".encode("gbk"),bytes)
True
>>>