python 类型判断
t1 = type(123) == type(456)
print(t1)
t2 = type(123) == int
print(t2)
t3 = type('a') == type('1')
print(t3)
t4 = type('a') == str
print(t4)
t5 = type(123) == type('123')
print(t5)
t6 = isinstance('a', str)
print(t6)
t7 = isinstance(123, (list, int, str))
print(t7)
import types
def fn():
pass
t1 = type(fn) == types.FunctionType
print(t1)
t2 = type(abs)==types.BuiltinFunctionType
print(t2)
t3 = type(lambda x: x)==types.LambdaType
print(t3)
t4 = type((x for x in range(10)))==types.GeneratorType
print(t4)