In python, how do I determine if a variable is Iterable?

Is there a method like isiterable? The only solution I have found so far is to call

getattr(myObj, '__iter__', False)

But I am not sure how fool-proof this is.

该问题永久链接

0 个答案

你的回答

or
verfycode

不是你要找的答案?你可以浏览其他相关标签 或者提交问题.