In this question there are numerous ways to test for an iterable. Two of the solutions are:
hasattr(object, '__iter__')
isinstance(object, collections.Iterable)
They both seem to do the same thing and I can't find any doc that differentiates them. What is the difference and why would I choose one over the other?