assert type(obj) is str print("xxx")
assert type(obj) is int print("xxx")
if typr(obj) is str: exit() #效果相同,但assert装逼效果更明显。