I think you should use `collections.Iterable` here.