I haven’t seen any article or document citing exactly how to do this "great". Meanwhile, the Miku, of Stackoverflow in English, cited some examples.
You can try something like:
1- Assuming the object is always iterable and then capturing the error if it is not, in style Pythonico - EAFP (Easier to Ask Forgiveness than Permission) - "better to ask forgiveness than permission"
try:
_ = (e for e in my_object)
except TypeError:
print my_object, 'is not iterable'
Or:
2- Using the module collections
import collections
if isinstance(e, collections.Iterable):
# e is iterable
Who negatived, could give a feedback to know what can be improving the quality of the question?
– Wallace Maxters
As @jbueno showed the best is with iter. Here is an interesting article about iterables: The Iterator Protocol: How for Loops Work in Python
– DekTorr