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

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

print(isinstance(test_data,Iterable))


outputs:
True

 

posted @ 2019-08-26 13:53  爱打盹的猫猫  阅读(1273)  评论(0编辑  收藏  举报