Shouldn't this be `return isinstance(x, collections.Iterator)` instead? Actually we should remove all reference to this function by a `collection.Iterator` instance check.