python如何判断一个对象是否是可迭代的?

from  collections import Iterable
test_data = [{"type":1,"keyword":None},
             {"type":2,"keyword":None}]

print(isinstance(test_data,Iterable))


outputs:
True

猜你喜欢

转载自www.cnblogs.com/wang-mengmeng/p/11412131.html