Closed kdheepak closed 2 years ago
I don't think this is an issue. The only reason we have FlattenIteratorWrapper
to extend Base.Iterators.Flatten
with the length
method for cases where we do actually know the length of the underlying iterables. You also can't call length(Base.Iterators.Flatten)
. I think that calling collect
on the iterator is what you should have to do in order to get a single, sortable container. One of the goals of get_components
is to provide a read-only iterator over existing containers rather than allocating new containers. If you have a different expectation, please elaborate.
I think your explanation makes sense about the current implementation and I’m happy to close this.
My opinion is that users reading the function name get_components
or reading the docstring for it might have an expectation that this function returns a collection, and not a container that can yield a collection. Maybe a clarification in the docs is the only action item here.
I'm unable to run the following:
The workaround is to wrap
get_components(PowerLoad, sys)
withcollect(...)
.