I think it's more idiomatic to test isinstance(foo, collections.Iterable): http://stackoverflow.com/a/4668647