Python: how to determine if an object is iterable?

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

hasattr(myObj, '__iter__')

but I am not sure how foolproof this is.

← Назад к списку