is 判断 id() 是不是相同 == 判断值是否相等 isinstance() 会查找继承链,判断类型。 使用 type()的话会有误差。 使用 isinstance() 而不是 type() 来判断类型。